Improved label consistency

This commit is contained in:
2025-02-21 17:04:13 +01:00
parent 08436c31c0
commit 4caac57210
11 changed files with 36 additions and 31 deletions

View File

@ -1,8 +1,6 @@
package core
import (
"fmt"
"git.akyoto.dev/cli/q/src/asm"
"git.akyoto.dev/cli/q/src/ast"
)
@ -10,8 +8,8 @@ import (
// CompileAssert compiles an assertion.
func (f *Function) CompileAssert(assert *ast.Assert) error {
f.count.assert++
success := fmt.Sprintf("%s_assert_%d_true", f.UniqueName, f.count.assert)
fail := fmt.Sprintf("%s_assert_%d_false", f.UniqueName, f.count.assert)
success := f.CreateLabel("assert true", f.count.assert)
fail := f.CreateLabel("assert false", f.count.assert)
err := f.CompileCondition(assert.Condition, success, fail)
if err != nil {