Enforced consistent naming

This commit is contained in:
2024-06-26 23:24:11 +02:00
parent d1a3ffb1a5
commit 94151773a5
10 changed files with 180 additions and 150 deletions

View File

@ -140,29 +140,6 @@ func (f *Function) ExpressionToRegister(root *expression.Expression, register cp
return f.Execute(operation, register, right)
}
// Execute executes an operation on a register with a value operand.
func (f *Function) Execute(operation token.Token, register cpu.Register, value *expression.Expression) error {
if value.IsLeaf() {
return f.Calculate(register, operation, value.Token)
}
temporary, found := f.CPU.FindFree(f.CPU.General)
if !found {
panic("no free registers")
}
f.CPU.Use(temporary)
defer f.CPU.Free(temporary)
err := f.ExpressionToRegister(value, temporary)
if err != nil {
return err
}
return f.CalculateRegisterRegister(operation, register, temporary)
}
// TokenToRegister moves a token into a register.
// It only works with identifiers, numbers and strings.
func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {