From f52b4de3b29ee27213b7d60fb620a0d5d50b49f9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 29 Nov 2022 18:17:33 -0800 Subject: Allow `no_diff` modifier on parameters (#2538) --- source/slang/slang-parser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-parser.cpp') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index ab849a98b..fd0810214 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -1122,6 +1122,14 @@ namespace Slang AddModifier(&modifierLink, parsedModifier); continue; } + else if (AdvanceIf(parser, "no_diff")) + { + parsedModifier = parser->astBuilder->create(); + parsedModifier->keywordName = nameToken.getName(); + parsedModifier->loc = nameToken.loc; + AddModifier(&modifierLink, parsedModifier); + continue; + } // If there was no match for a modifier keyword, then we // must be at the end of the modifier sequence @@ -1459,7 +1467,7 @@ namespace Slang // Allow a declaration to use the keyword `void` for a parameter list, // since that was required in ancient C, and continues to be supported - // in a bunc hof its derivatives even if it is a Bad Design Choice + // in a bunch of its derivatives even if it is a Bad Design Choice // // TODO: conditionalize this so we don't keep this around for "pure" // Slang code -- cgit v1.2.3