Simplified code

This commit is contained in:
Eduard Urbach 2024-07-23 22:14:23 +02:00
parent abba962455
commit eeee4d5496
Signed by: eduard
GPG key ID: 49226B848C78F6C8
30 changed files with 105 additions and 69 deletions

View file

@ -21,8 +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)
f.CurrentScope().Reserve(register)
register := f.NewRegister()
err := f.ExpressionToRegister(node.Value, register)
f.AddVariable(&scope.Variable{