summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/check.cpp3
-rw-r--r--source/slang/parser.cpp17
2 files changed, 12 insertions, 8 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index bc3823292..79a4f28cf 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -1972,8 +1972,9 @@ namespace Slang
return;
VisitFunctionDeclaration(functionNode);
- // TODO: This should really onlye set "checked header"
+ // TODO: This should really only set "checked header"
functionNode->SetCheckState(DeclCheckState::Checked);
+
// TODO: should put the checking of the body onto a "work list"
// to avoid recursion here.
if (functionNode->Body)
diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp
index 954496b68..57956485a 100644
--- a/source/slang/parser.cpp
+++ b/source/slang/parser.cpp
@@ -1428,8 +1428,7 @@ namespace Slang
return typeExpr;
}
- static TypeSpec
- parseTypeSpec(Parser* parser)
+ static TypeSpec parseTypeSpec(Parser* parser)
{
TypeSpec typeSpec;
@@ -1462,15 +1461,19 @@ namespace Slang
RefPtr<Expr> typeExpr = basicType;
- while (parser->LookAheadToken(TokenType::OpLess) || parser->LookAheadToken(TokenType::Dot))
+ bool shouldLoop = true;
+ while (shouldLoop)
{
- if (parser->LookAheadToken(TokenType::OpLess))
+ switch (peekTokenType(parser))
{
+ case TokenType::OpLess:
typeExpr = parseGenericApp(parser, typeExpr);
- }
- else
- {
+ break;
+ case TokenType::Dot:
typeExpr = parseMemberType(parser, typeExpr);
+ break;
+ default:
+ shouldLoop = false;
}
}