1
0
Fork 0

Fix bug with scopes

This commit is contained in:
Vili Sinervä 2025-02-26 19:43:43 +02:00
parent 50d3d60a7f
commit 340de3c984
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
2 changed files with 5 additions and 3 deletions

View file

@ -333,9 +333,11 @@ fn visit_ast_node<'source>(
}
Block(expressions) => {
let mut result_var = add_var(&Type::Unit, types);
symbols.push_level();
for expression in expressions {
result_var = visit_ast_node(expression, types, symbols, instructions, labels);
}
symbols.remove_level();
result_var
}
}