Cleanup + little polymorph + ast_copy
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user