summaryrefslogtreecommitdiff
path: root/boot/tokenizer.s
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-05-06 23:58:46 +0200
committerEugen Wissner <belka@caraus.de>2025-05-06 23:58:46 +0200
commit40701008f04f2242ab69bfb4bc4f376e6b75429a (patch)
tree4304c2a75004e35e9f198500a484cbfdedab4c5c /boot/tokenizer.s
parent3bd86e6e1cf9634af0f45ed526181351328b350d (diff)
downloadelna-40701008f04f2242ab69bfb4bc4f376e6b75429a.tar.gz
Replace _read_token with the lexer
Diffstat (limited to 'boot/tokenizer.s')
-rw-r--r--boot/tokenizer.s36
1 files changed, 18 insertions, 18 deletions
diff --git a/boot/tokenizer.s b/boot/tokenizer.s
index bf8e443..647a3b6 100644
--- a/boot/tokenizer.s
+++ b/boot/tokenizer.s
@@ -268,7 +268,7 @@ transitions:
.word 0x08ff, 0x0103, 0x00ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff
.word 0x08ff, 0x00ff, 0x08ff, 0x00ff, 0x0103, 0x00ff, 0x08ff, 0x08ff
- .word 0x08ff, 0x08ff, 0x08ff, 0x08ff # 0x03 Integer
+ .word 0x08ff, 0x08ff, 0x08ff, 0x08ff # 0x03 Decimal
.word 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x04ff, 0x02ff, 0x02ff
.word 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff
@@ -286,9 +286,9 @@ transitions:
.word 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff
.word 0x02ff, 0x02ff, 0x02ff, 0x04ff # 0x07 Less
- .word 0x02ff, 0x0102, 0x0102, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff
- .word 0x02ff, 0x0102, 0x02ff, 0x0102, 0x0102, 0x0102, 0x02ff, 0x02ff
- .word 0x02ff, 0x02ff, 0x02ff, 0x02ff # 0x08 Dot
+ .word 0x08ff, 0x0108, 0x00ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff
+ .word 0x08ff, 0x00ff, 0x08ff, 0x0108, 0x0108, 0x00ff, 0x08ff, 0x08ff
+ .word 0x08ff, 0x08ff, 0x08ff, 0x08ff # 0x08 Hexadecimal after 0x.
.word 0x0109, 0x0109, 0x0109, 0x0109, 0x0109, 0x0109, 0x0109, 0x0109
.word 0x010a, 0x0109, 0x0109, 0x0109, 0x0109, 0x0109, 0x00ff, 0x0109
@@ -302,13 +302,13 @@ transitions:
.word 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x0110
.word 0x010b, 0x04ff, 0x010b, 0x010b # 0x0b String
- .word 0x02ff, 0x00ff, 0x00ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff
- .word 0x02ff, 0x02ff, 0x02ff, 0x00ff, 0x00ff, 0x010d, 0x02ff, 0x02ff
- .word 0x02ff, 0x02ff, 0x02ff, 0x02ff # 0x0c Zero
+ .word 0x08ff, 0x00ff, 0x00ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff, 0x08ff
+ .word 0x08ff, 0x00ff, 0x08ff, 0x00ff, 0x00ff, 0x010d, 0x08ff, 0x08ff
+ .word 0x08ff, 0x08ff, 0x08ff, 0x08ff # 0x0c Leading zero
- .word 0x02ff, 0x010d, 0x00ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff, 0x02ff
- .word 0x02ff, 0x02ff, 0x02ff, 0x010d, 0x010d, 0x00ff, 0x2ff, 0x02ff
- .word 0x00ff, 0x02ff, 0x02ff, 0x02ff # 0x0d Hexadecimal
+ .word 0x00ff, 0x0108, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff
+ .word 0x00ff, 0x00ff, 0x00ff, 0x0108, 0x0108, 0x00ff, 0x00ff, 0x00ff
+ .word 0x00ff, 0x00ff, 0x00ff, 0x00ff # 0x0d Starting hexadecimal
.section .text
@@ -592,14 +592,14 @@ _tokenize_next:
j .Ltokenize_next_end
.Ltokenize_next_integer:
- lw a1, 12(sp)
- sub a0, s1, a1
- sw a0, 8(sp)
- sw a0, 4(sp)
- lw a0, 0(sp)
- addi a1, sp, 4
- li a2, 12
- call _memcpy
+ lw t0, 0(sp)
+ li t1, TOKEN_INTEGER
+ sw t1, 0(t0)
+ lw t1, 12(sp)
+ sw t1, 8(t0)
+ sub t1, s1, t1
+ sw t1, 4(t0)
+
j .Ltokenize_next_end
.Ltokenize_next_end: