summaryrefslogtreecommitdiffstats
path: root/source/slang/parser.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-04 20:21:19 -0400
committerYong He <yonghe@outlook.com>2017-11-04 20:21:19 -0400
commit0d250f0d49e9e29d143c5794671669ea025b357e (patch)
treed73a0ea8a7f847c4ff3facbb91b79afbcbfe987b /source/slang/parser.cpp
parent6e4ba9bd552923b08cd56b4542b2f29e8df8ca0c (diff)
style fixes
Diffstat (limited to 'source/slang/parser.cpp')
-rw-r--r--source/slang/parser.cpp17
1 files changed, 10 insertions, 7 deletions
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;
}
}