Implemented runes

This commit is contained in:
2024-07-22 15:32:16 +02:00
parent e91e894046
commit 21017e6378
11 changed files with 88 additions and 27 deletions

View File

@ -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: