From ad9759bc8e993364490d7268d491620ee4a2cc24 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 20 Jan 2016 02:12:24 -0700 Subject: basic support for switch expression --- src/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parser.cpp') 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); -- cgit v1.2.3