aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-14 17:24:56 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-14 17:24:56 +0000
commit2722de65b7e2397c0b968abc4c652711095ec7ca (patch)
tree49a6d32999893197566cde6b65263d37e03618e8 /src/parser.c
parent8b5e3428a1e569abf763e63e859754e767e107e7 (diff)
Prevent `cast` on pointer to union types
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c6
1 files changed, 3 insertions, 3 deletions
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));