From e19e0474639d579e6f0dc33d6b0c9b2a6d723fae Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:20:43 -0700 Subject: Parse scope for local variable declaration (#4507) When a local variable is declaraed, a scope(::) was not properly parsed for its type name. This commit fixes it. Close #4457 --- source/slang/slang-parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index e6913c6c0..aefe7f362 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -5349,9 +5349,9 @@ namespace Slang { statement = ParseExpressionStatement(); } - else if (LookAheadToken(TokenType::Identifier)) + else if (LookAheadToken(TokenType::Identifier) || LookAheadToken(TokenType::Scope)) { - if (LookAheadToken(TokenType::Colon, 1)) + if (LookAheadToken(TokenType::Identifier) && LookAheadToken(TokenType::Colon, 1)) { // An identifier followed by an ":" is a label. return parseLabelStatement(); -- cgit v1.2.3