Cleanup + little polymorph + ast_copy

This commit is contained in:
Krzosa Karol
2023-03-31 08:19:26 +02:00
parent 21c8ceff03
commit aaf1b2f2d9
11 changed files with 406 additions and 15 deletions

View File

@@ -735,8 +735,7 @@ parse_struct(Token *pos, Ast_Kind kind) {
Ast_Expr *typespec = parse_expr();
Ast_Decl *decl = ast_var(token, typespec, token->intern_val, 0);
decl->flags = set_flag(decl->flags, AST_AGGREGATE_CHILD);
set_flag(decl->flags, AST_AGGREGATE_CHILD);
add(pctx->perm, &scope->decls, decl);
} while (token_match(SAME_SCOPE));
@@ -760,7 +759,6 @@ parse_enum(Token *pos) {
Ast_Expr *value = 0;
if (token_match(TK_DoubleColon)) value = parse_expr();
Ast_Decl *member = ast_const(name, name->intern_val, value);
member->flags = set_flag(member->flags, AST_AGGREGATE_CHILD);
add(pctx->perm, &scope->decls, member);
} while (token_match(SAME_SCOPE));
finalize_decl_scope(scope);