Added scope package
This commit is contained in:
parent
fd66296826
commit
8e725da9c6
37 changed files with 416 additions and 371 deletions
|
@ -12,10 +12,10 @@ func (f *Function) CompileLoop(loop *ast.Loop) error {
|
|||
f.count.loop++
|
||||
label := fmt.Sprintf("%s_loop_%d", f.Name, f.count.loop)
|
||||
f.AddLabel(label)
|
||||
scope := f.pushScope(loop.Body)
|
||||
scope.inLoop = true
|
||||
scope := f.PushScope(loop.Body)
|
||||
scope.InLoop = true
|
||||
err := f.CompileAST(loop.Body)
|
||||
f.Jump(asm.JUMP, label)
|
||||
f.popScope()
|
||||
f.PopScope()
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue