Restructure

This commit is contained in:
Krzosa Karol
2022-05-31 18:29:35 +02:00
parent 20accf8293
commit 0360086bab
7 changed files with 516 additions and 479 deletions

View File

@@ -207,8 +207,11 @@ parse_block(){
if(token_match_keyword(keyword_return)){
Ast_Expr *expr = 0;
if(!token_is_scope()) expr = parse_expr();
Ast_Return *return_stmt = ast_return(token, expr);
stmts.add(return_stmt);
stmts.add(ast_return(token, expr));
}
else if(token_match_keyword(keyword_pass)){
stmts.add(ast_pass(token));
}
else if(token_match_keyword(keyword_for)){
@@ -225,7 +228,8 @@ parse_block(){
}
}
stmts.add(ast_for(token, actual_init, cond, iter, parse_block()));
Ast_Block *for_block = parse_block();
stmts.add(ast_for(token, actual_init, cond, iter, for_block));
}
else if(token_match_keyword(keyword_if)){