Core: Add goto

This commit is contained in:
Krzosa Karol
2023-04-22 13:14:08 +02:00
parent eff6b10cf4
commit 654d6f17e4
10 changed files with 42 additions and 9 deletions

View File

@@ -423,6 +423,12 @@ parse_stmt_scope(Ast_Scope *scope_defined_outside = 0) {
scope->stmts.add(result_if);
}
else if (token_match_keyword(pctx->keyword_goto)) {
Token *ident = token_expect(TK_Identifier);
Ast_Goto *result = ast_goto(token, ident->intern_val);
scope->stmts.add(result);
}
// Label
else if (token_match(TK_Colon)) {
Token *ident = token_expect(TK_Identifier);