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

View File

@ -11,8 +11,8 @@ import (
func (f *Function) CompileCondition(condition *expression.Expression, successLabel string, failLabel string) error {
switch condition.Token.Text() {
case "||":
leftFailLabel := fmt.Sprintf("%s_false_%d", f.Name, f.count.subBranch)
f.count.subBranch++
leftFailLabel := fmt.Sprintf("%s_false_%d", f.Name, f.count.subBranch)
// Left
left := condition.Children[0]
@ -38,8 +38,8 @@ func (f *Function) CompileCondition(condition *expression.Expression, successLab
return err
case "&&":
leftSuccessLabel := fmt.Sprintf("%s_true_%d", f.Name, f.count.subBranch)
f.count.subBranch++
leftSuccessLabel := fmt.Sprintf("%s_true_%d", f.Name, f.count.subBranch)
// Left
left := condition.Children[0]