Improved separation of concerns
This commit is contained in:
parent
dc5456b820
commit
abba962455
36 changed files with 243 additions and 236 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"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"
|
||||
)
|
||||
|
||||
// NewFunction creates a new function.
|
||||
|
@ -15,19 +16,20 @@ func NewFunction(name string, file *fs.File, body []token.Token) *Function {
|
|||
Name: name,
|
||||
File: file,
|
||||
Body: body,
|
||||
Assembler: asm.Assembler{
|
||||
Instructions: make([]asm.Instruction, 0, 8),
|
||||
Compiler: z.Compiler{
|
||||
Assembler: asm.Assembler{
|
||||
Instructions: make([]asm.Instruction, 0, 8),
|
||||
},
|
||||
Stack: scope.Stack{
|
||||
Scopes: []*scope.Scope{{}},
|
||||
},
|
||||
CPU: cpu.CPU{
|
||||
All: x64.AllRegisters,
|
||||
Input: x64.CallRegisters,
|
||||
General: x64.GeneralRegisters,
|
||||
Syscall: x64.SyscallRegisters,
|
||||
Output: x64.ReturnValueRegisters,
|
||||
},
|
||||
},
|
||||
Stack: scope.Stack{
|
||||
Scopes: []*scope.Scope{{}},
|
||||
},
|
||||
cpu: cpu.CPU{
|
||||
All: x64.AllRegisters,
|
||||
Input: x64.CallRegisters,
|
||||
General: x64.GeneralRegisters,
|
||||
Syscall: x64.SyscallRegisters,
|
||||
Output: x64.ReturnValueRegisters,
|
||||
},
|
||||
finished: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue