Improved separation of concerns
This commit is contained in:
parent
dc5456b820
commit
abba962455
36 changed files with 243 additions and 236 deletions
|
@ -11,7 +11,7 @@ import (
|
|||
func (f *Function) CompileDefinition(node *ast.Define) error {
|
||||
name := node.Name.Text(f.File.Bytes)
|
||||
|
||||
if f.identifierExists(name) {
|
||||
if f.IdentifierExists(name) {
|
||||
return errors.New(&errors.VariableAlreadyExists{Name: name}, f.File, node.Name.Position)
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
return errors.New(&errors.UnusedVariable{Name: name}, f.File, node.Name.Position)
|
||||
}
|
||||
|
||||
register := f.CurrentScope().MustFindFree(f.cpu.General)
|
||||
register := f.CurrentScope().MustFindFree(f.CPU.General)
|
||||
f.CurrentScope().Reserve(register)
|
||||
err := f.ExpressionToRegister(node.Value, register)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue