Implemented parameters
This commit is contained in:
@ -17,7 +17,6 @@ import (
|
||||
type Function struct {
|
||||
Name string
|
||||
File *fs.File
|
||||
Head token.List
|
||||
Body token.List
|
||||
Variables map[string]*Variable
|
||||
Assembler asm.Assembler
|
||||
@ -152,7 +151,10 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
return errors.New(&errors.UnknownIdentifier{Name: name}, f.File, t.Position)
|
||||
}
|
||||
|
||||
f.Assembler.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
if register != variable.Register {
|
||||
f.Assembler.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
case token.Number:
|
||||
|
Reference in New Issue
Block a user