Improved label consistency
This commit is contained in:
parent
a8d15a4305
commit
1268344238
11 changed files with 36 additions and 31 deletions
|
@ -1,8 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/expression"
|
||||
"git.akyoto.dev/cli/q/src/token"
|
||||
)
|
||||
|
@ -12,7 +10,7 @@ func (f *Function) CompileCondition(condition *expression.Expression, successLab
|
|||
switch condition.Token.Kind {
|
||||
case token.LogicalOr:
|
||||
f.count.subBranch++
|
||||
leftFailLabel := fmt.Sprintf("%s_false_%d", f.UniqueName, f.count.subBranch)
|
||||
leftFailLabel := f.CreateLabel("false", f.count.subBranch)
|
||||
|
||||
// Left
|
||||
left := condition.Children[0]
|
||||
|
@ -39,7 +37,7 @@ func (f *Function) CompileCondition(condition *expression.Expression, successLab
|
|||
|
||||
case token.LogicalAnd:
|
||||
f.count.subBranch++
|
||||
leftSuccessLabel := fmt.Sprintf("%s_true_%d", f.UniqueName, f.count.subBranch)
|
||||
leftSuccessLabel := f.CreateLabel("true", f.count.subBranch)
|
||||
|
||||
// Left
|
||||
left := condition.Children[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue