Parsing union

This commit is contained in:
Krzosa Karol
2023-03-29 09:34:33 +02:00
parent fa26e9d218
commit b572f4ef7c
4 changed files with 18 additions and 10 deletions

View File

@@ -214,8 +214,10 @@ finalize_stmt_scope(Ast_Scope *scope) {
}
CORE_Static Ast_Decl *
ast_struct(Token *pos, Ast_Scope *scope) {
ast_struct(Token *pos, Ast_Scope *scope, Ast_Kind kind = AST_STRUCT) {
assert(kind == AST_STRUCT || kind == AST_UNION);
AST_NEW(Decl, STRUCT, pos, AST_DECL | AST_AGGREGATE);
result->kind = kind;
result->scope = scope;
return result;
}