summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-06-28 21:20:43 -0700
committerGitHub <noreply@github.com>2024-06-28 21:20:43 -0700
commite19e0474639d579e6f0dc33d6b0c9b2a6d723fae (patch)
treeb607c55aa0eee9f41217fc2259a1e3837465528a /source
parent88382ac7f3eda671c21dadb5b37bfd305369f750 (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-parser.cpp4
1 files changed, 2 insertions, 2 deletions
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();