diff options
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 0e9b20e52..5ba18d4a1 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1759,6 +1759,17 @@ Ast *parse_operand(AstFile *f, bool lhs) { break; } return original_type; + } else if (name.string == "partial") { + Ast *tag = ast_basic_directive(f, token, name.string); + Ast *original_type = parse_type(f); + Ast *type = unparen_expr(original_type); + switch (type->kind) { + case Ast_ArrayType: type->ArrayType.tag = tag; break; + default: + syntax_error(type, "Expected an enumerated array type after #%.*s, got %.*s", LIT(name.string), LIT(ast_strings[type->kind])); + break; + } + return original_type; } else if (name.string == "bounds_check") { Ast *operand = parse_expr(f, lhs); operand->state_flags |= StateFlag_bounds_check; |