Simplified code
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/asm"
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
"git.akyoto.dev/cli/q/src/build/errors"
|
||||
@ -36,10 +34,8 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
return nil
|
||||
|
||||
case token.String:
|
||||
f.count.data++
|
||||
label := fmt.Sprintf("%s_data_%d", f.Name, f.count.data)
|
||||
value := t.Bytes(f.File.Bytes)[1 : t.Length-1]
|
||||
f.Assembler.SetData(label, value)
|
||||
data := t.Bytes(f.File.Bytes)[1 : t.Length-1]
|
||||
label := f.AddBytes(data)
|
||||
f.RegisterLabel(asm.MOVE, register, label)
|
||||
return nil
|
||||
|
||||
|
Reference in New Issue
Block a user