analyze: make VarDecl statements insert symbols to current scope

This commit is contained in:
Luna 2019-09-27 14:07:42 -03:00
parent 466243fc2b
commit 3f94082477
3 changed files with 14 additions and 3 deletions

View file

@ -3,7 +3,7 @@ const (
)
fn f() i32 {
// var a = 3;
var a = 3;
// return a;
return 2;
}
@ -34,8 +34,10 @@ fn test_function() B {
fn multwo(num: i32, double_flag: bool) i32 {
// TODO resolve expr variables
if (true) {
var truthy = true;
return 1 * 2;
} else {
var falsey = false;
return 1;
}
}