Core: Add Ast_Label

This commit is contained in:
Krzosa Karol
2023-04-22 12:38:48 +02:00
parent d244608571
commit eff6b10cf4
10 changed files with 140 additions and 98 deletions

View File

@@ -177,6 +177,15 @@ ast_return(Token *pos, Ast_Expr *expr) {
return result;
}
CORE_Static Ast_Label *
ast_label(Token *pos, Intern_String name, Ast_Scope *scope, bool enable_goto) {
Ast_Label *result = ast_new(Ast_Label, AST_LABEL, pos, AST_STMT | AST_DECL);
result->enable_goto = enable_goto;
result->name = name;
result->scope = scope;
return result;
}
CORE_Static Ast_If_Node *
ast_if_node(Token *pos, Ast_Expr *init, Ast_Expr *expr, Ast_Scope *scope) {
AST_NEW(If_Node, IF_NODE, pos, AST_STMT);