diff options
| author | gingerBill <bill@gingerbill.org> | 2019-11-27 15:23:54 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-11-27 15:23:54 +0000 |
| commit | 71c8a3456e643367f27f1ada3028c07e8b38549f (patch) | |
| tree | 444949ca977069ccee4828ac353f92977e45f36a /src | |
| parent | 37e3e081c62b38bb4eff9553faadaea765f624b7 (diff) | |
Update package odin/parser for #soa and #vector
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 732c366ee..cfa6d7981 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1760,15 +1760,16 @@ Ast *parse_operand(AstFile *f, bool lhs) { return parse_call_expr(f, tag); } else if (name.string == "soa" || name.string == "vector") { Ast *tag = ast_basic_directive(f, token, name.string); - Ast *type = parse_type(f); + Ast *original_type = parse_type(f); + Ast *type = unparen_expr(original_type); switch (type->kind) { case Ast_ArrayType: type->ArrayType.tag = tag; break; case Ast_DynamicArrayType: type->DynamicArrayType.tag = tag; break; - default: + default: syntax_error(type, "Expected an array type after #%.*s, got %.*s", LIT(name.string), LIT(ast_strings[type->kind])); break; } - return type; + return original_type; } else { operand = ast_tag_expr(f, token, name, parse_expr(f, false)); } |