mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
Update package odin/parser for #soa and #vector
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user