Enforced consistent naming
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user