Fix if parsing bug

This commit is contained in:
Krzosa Karol
2022-06-03 15:38:29 +02:00
parent dd8fbc20ed
commit 14af46125d
3 changed files with 6 additions and 2 deletions

View File

@@ -218,6 +218,7 @@ parse_block(){
if(token_match(TK_Comma)) expr = parse_expr();
else expr = 0;
}
if(init_val == expr) init_val = 0;
Ast_Block *if_block = parse_block();
Ast_If_Node *if_node = ast_if_node(token, init_val, expr, if_block);