diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-31 13:49:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-31 13:49:40 -0700 |
| commit | cc412af89e54b04ead508ca84825a18d001b92d0 (patch) | |
| tree | da7bb020c494cc4dc62a9c641fb88d7b0b9f89f2 /source/slang/slang-parser.cpp | |
| parent | 1996785e1c5d76254a102c1ec0df5dd7e2e4d68a (diff) | |
Add SPIRV atomics intrinsics and fix buffer layout lowering. (#3170)
* Fix atomics intrinsics and buffer layout lowering.
* Fix.
* Add more test.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-parser.cpp')
| -rw-r--r-- | source/slang/slang-parser.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 3a1b627bd..b270ba713 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -6071,6 +6071,32 @@ namespace Slang parser->ReadToken(TokenType::Identifier); return varExpr; } + case TokenType::Scope: + { + parser->ReadToken(TokenType::Scope); + VarExpr* varExpr = parser->astBuilder->create<VarExpr>(); + varExpr->scope = parser->currentScope; + while (varExpr->scope && !as<ModuleDecl>(varExpr->scope->containerDecl)) + varExpr->scope = varExpr->scope->parent; + parser->FillPosition(varExpr); + + auto nameToken = peekToken(parser); + auto nameAndLoc = NameLoc(nameToken); + varExpr->name = nameAndLoc.name; + if (nameToken.type == TokenType::CompletionRequest) + { + parser->hasSeenCompletionToken = true; + } + else + { + parser->ReadToken(TokenType::Identifier); + if (peekTokenType(parser) == TokenType::OpLess) + { + return maybeParseGenericApp(parser, varExpr); + } + } + return varExpr; + } case TokenType::Identifier: { // We will perform name lookup here so that we can find syntax |
