Reordered counters

This commit is contained in:
2024-07-16 11:44:10 +02:00
parent 24d3e8f2be
commit 448af0707a
4 changed files with 11 additions and 8 deletions

@ -8,6 +8,7 @@ import (
// CompileIf compiles a branch instruction.
func (f *Function) CompileIf(branch *ast.If) error {
f.count.branch++
success := fmt.Sprintf("%s_if_%d_true", f.Name, f.count.branch)
fail := fmt.Sprintf("%s_if_%d_false", f.Name, f.count.branch)
err := f.CompileCondition(branch.Condition, success, fail)
@ -16,7 +17,6 @@ func (f *Function) CompileIf(branch *ast.If) error {
return err
}
f.count.branch++
f.AddLabel(success)
f.pushScope()
err = f.CompileAST(branch.Body)