Implemented runes
This commit is contained in:
@ -2,7 +2,6 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/asm"
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
@ -26,15 +25,14 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
f.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
return nil
|
||||
|
||||
case token.Number:
|
||||
value := t.Text(f.File.Bytes)
|
||||
n, err := strconv.Atoi(value)
|
||||
case token.Number, token.Rune:
|
||||
number, _, err := f.Number(t)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f.RegisterNumber(asm.MOVE, register, n)
|
||||
f.RegisterNumber(asm.MOVE, register, number)
|
||||
return nil
|
||||
|
||||
case token.String:
|
||||
|
Reference in New Issue
Block a user