Iterator + start to add core to core codegen

This commit is contained in:
Krzosa Karol
2023-03-31 17:38:32 +02:00
parent 1839279235
commit 277404fe95
6 changed files with 198 additions and 61 deletions

View File

@@ -240,6 +240,7 @@ ast_enum(Token *pos, Ast_Expr *typespec, Ast_Scope *scope) {
AST_NEW(Decl, ENUM, pos, AST_DECL);
result->scope = scope;
result->typespec = typespec;
if (typespec) set_flag(typespec->flags, AST_TYPESPEC);
return result;
}
@@ -248,6 +249,7 @@ ast_var(Token *pos, Ast_Expr *typespec, Intern_String name, Ast_Expr *expr) {
AST_NEW(Decl, VAR, pos, AST_DECL);
result->name = name;
result->typespec = typespec;
if (typespec) set_flag(typespec->flags, AST_TYPESPEC);
result->expr = expr;
return result;
}