aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-20 02:12:24 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-20 02:12:24 -0700
commitad9759bc8e993364490d7268d491620ee4a2cc24 (patch)
tree952a04c2e6d7e37132a0881e45e4ac1d4227e2e0 /src/parser.cpp
parent3eca42c17be1105dbc76c22fdc8447bccf11de0d (diff)
downloadzig-ad9759bc8e993364490d7268d491620ee4a2cc24.tar.gz
zig-ad9759bc8e993364490d7268d491620ee4a2cc24.zip
basic support for switch expression
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 32ecc9885a..0dfb60a47a 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2255,8 +2255,8 @@ static AstNode *ast_parse_switch_expr(ParseContext *pc, int *token_index, bool m
break;
}
- Token *arrow_or_comma = &pc->tokens->at(*token_index);
- if (arrow_or_comma->id == TokenIdComma) {
+ Token *arrow_or_colon = &pc->tokens->at(*token_index);
+ if (arrow_or_colon->id == TokenIdColon) {
*token_index += 1;
ast_eat_token(pc, token_index, TokenIdLParen);
prong_node->data.switch_prong.var_symbol = ast_parse_symbol(pc, token_index);