From 2722de65b7e2397c0b968abc4c652711095ec7ca Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Tue, 14 Feb 2017 17:24:56 +0000 Subject: Prevent `cast` on pointer to union types --- src/parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index fedde531e..987022068 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2574,8 +2574,8 @@ AstNode *parse_type_or_ident(AstFile *f) { AstNode *count_expr = NULL; bool is_vector = false; - if (f->curr_token.kind == Token_Question) { - count_expr = ast_unary_expr(f, expect_token(f, Token_Question), NULL); + if (f->curr_token.kind == Token_Ellipsis) { + count_expr = ast_unary_expr(f, expect_token(f, Token_Ellipsis), NULL); } else if (f->curr_token.kind == Token_vector) { next_token(f); if (f->curr_token.kind != Token_CloseBracket) { @@ -2586,7 +2586,7 @@ AstNode *parse_type_or_ident(AstFile *f) { syntax_error(f->curr_token, "Vector type missing count"); } is_vector = true; - } else if (f->curr_token.kind == Token_Ellipsis) { + } else if (f->curr_token.kind == Token_dynamic) { next_token(f); expect_token(f, Token_CloseBracket); return ast_dynamic_array_type(f, token, parse_type(f)); -- cgit v1.2.3