From cc412af89e54b04ead508ca84825a18d001b92d0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 31 Aug 2023 13:49:40 -0700 Subject: 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 --- source/slang/slang-parser.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/slang/slang-parser.cpp') 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->scope = parser->currentScope; + while (varExpr->scope && !as(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 -- cgit v1.2.3