diff options
| author | Yong He <yonghe@outlook.com> | 2022-11-29 18:17:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-29 18:17:33 -0800 |
| commit | f52b4de3b29ee27213b7d60fb620a0d5d50b49f9 (patch) | |
| tree | d4570c53045bca8e9411e884b0905d9384430a58 /source/slang/slang-parser.cpp | |
| parent | f5581786a1891cedb165adb1afe71fe34f26e030 (diff) | |
Allow `no_diff` modifier on parameters (#2538)
Diffstat (limited to 'source/slang/slang-parser.cpp')
| -rw-r--r-- | source/slang/slang-parser.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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<NoDiffModifier>(); + 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 |
