Improved separation of concerns

This commit is contained in:
2024-07-23 16:41:21 +02:00
parent d6db1b1096
commit 69245caf62
36 changed files with 243 additions and 236 deletions

View File

@ -1,26 +1,20 @@
package core
import (
"git.akyoto.dev/cli/q/src/build/asm"
"git.akyoto.dev/cli/q/src/build/cpu"
"git.akyoto.dev/cli/q/src/build/fs"
"git.akyoto.dev/cli/q/src/build/scope"
"git.akyoto.dev/cli/q/src/build/token"
"git.akyoto.dev/cli/q/src/build/z"
)
// Function represents the smallest unit of code.
type Function struct {
scope.Stack
Name string
File *fs.File
Body []token.Token
Assembler asm.Assembler
Functions map[string]*Function
Err error
registerHistory []uint64
finished chan struct{}
cpu cpu.CPU
count counter
z.Compiler
Name string
File *fs.File
Body []token.Token
Functions map[string]*Function
Err error
count counter
}
// counter stores how often a certain statement appeared so we can generate a unique label from it.