Implemented variable scopes
This commit is contained in:
@ -16,8 +16,11 @@ func (f *Function) CompileIf(branch *ast.If) error {
|
||||
return err
|
||||
}
|
||||
|
||||
f.AddLabel(success)
|
||||
defer f.AddLabel(fail)
|
||||
f.count.branch++
|
||||
return f.CompileAST(branch.Body)
|
||||
f.AddLabel(success)
|
||||
f.pushScope()
|
||||
err = f.CompileAST(branch.Body)
|
||||
f.popScope()
|
||||
f.AddLabel(fail)
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user