Refactored code structure
This commit is contained in:
parent
9e52e2dd1c
commit
fd6e874b44
54 changed files with 583 additions and 450 deletions
|
@ -1,16 +0,0 @@
|
|||
package build
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/ast"
|
||||
)
|
||||
|
||||
// CompileLoop compiles a loop instruction.
|
||||
func (f *Function) CompileLoop(loop *ast.Loop) error {
|
||||
label := fmt.Sprintf("%s_loop_%d", f.Name, f.count.loop)
|
||||
f.assembler.Label(label)
|
||||
defer f.assembler.Jump(label)
|
||||
f.count.loop++
|
||||
return f.CompileAST(loop.Body)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue