Improved code generation

This commit is contained in:
Eduard Urbach 2024-07-09 17:00:04 +02:00
parent 6e22febc01
commit 3c189a025f
Signed by: eduard
GPG key ID: 49226B848C78F6C8
23 changed files with 201 additions and 95 deletions

View file

@ -3,7 +3,6 @@ package core
import (
"fmt"
"git.akyoto.dev/cli/q/src/build/asm"
"git.akyoto.dev/cli/q/src/build/ast"
)
@ -17,8 +16,8 @@ func (f *Function) CompileIf(branch *ast.If) error {
return err
}
f.assembler.Label(asm.LABEL, success)
defer f.assembler.Label(asm.LABEL, fail)
f.AddLabel(success)
defer f.AddLabel(fail)
f.count.branch++
return f.CompileAST(branch.Body)
}