From 812e478989e27983b8dea7ab11964de751654ba2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 4 Jun 2025 13:05:58 -0700 Subject: Make interface types non c-style in Slang2026. (#7260) * Make interface types non c-style. * Make Optional work with autodiff and existential types. * Fix. * patch behind slang 2026. * Fix warnings. * cleanup. * Fix tests. * Fix. * Fix com interface lowering. * Add comment to test. * regenerate command line reference * Add test for passing `none` to autodiff function. * Fix recording of `getDynamicObjectRTTIBytes`. * Fix nested Optional types. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/core/slang-string-escape-util.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/core/slang-string-escape-util.cpp') diff --git a/source/core/slang-string-escape-util.cpp b/source/core/slang-string-escape-util.cpp index 0645d94ba..c079b8b39 100644 --- a/source/core/slang-string-escape-util.cpp +++ b/source/core/slang-string-escape-util.cpp @@ -1099,6 +1099,22 @@ StringEscapeUtil::Handler* StringEscapeUtil::getHandler(Style style) } } +/* static */ UnownedStringSlice StringEscapeUtil::maybeUnquoteCommandLineArg( + UnownedStringSlice slice) +{ + // If the slice is quoted, unquote it, else return as is + if (slice.startsWith("\'") || slice.startsWith("\"")) + { + const Index len = slice.getLength(); + if (len >= 2 && slice[len - 1] == slice[0]) + { + // Unquote it + return UnownedStringSlice(slice.begin() + 1, len - 2); + } + } + return slice; +} + /* static */ bool StringEscapeUtil::isQuoted(char quoteChar, UnownedStringSlice& slice) { const Index len = slice.getLength(); -- cgit v1.2.3