analyze: make VarDecl statements insert symbols to current scope
This commit is contained in:
parent
466243fc2b
commit
3f94082477
3 changed files with 14 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue