commit 5196ecc1532587f11d1340fe1843f1fac706c255
parent 58dfac01f784ab9639dd8e0f65f6b7c52db93f83
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 24 Jan 2021 12:28:19 -0500
parse: fix slicing anything other than a number
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/parse.c b/src/parse.c
@@ -1111,13 +1111,11 @@ parse_index_slice_expression(struct lexer *lexer, struct ast_expression *lvalue)
break;
case T_RBRACKET:
break;
- case T_LITERAL:
+ default:
if (is_slice) {
unlex(lexer, &tok);
break;
}
- // Fallthrough
- default:
synassert(false, &tok, T_SLICE, T_RBRACKET, T_EOF);
break;
}