diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-04 20:21:19 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-04 20:21:19 -0400 |
| commit | 0d250f0d49e9e29d143c5794671669ea025b357e (patch) | |
| tree | d73a0ea8a7f847c4ff3facbb91b79afbcbfe987b /source/slang/parser.cpp | |
| parent | 6e4ba9bd552923b08cd56b4542b2f29e8df8ca0c (diff) | |
style fixes
Diffstat (limited to 'source/slang/parser.cpp')
| -rw-r--r-- | source/slang/parser.cpp | 17 |
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; } } |
