add get_opcode and its test, fix a couple bugs + semantics things

This commit is contained in:
andromeda
2026-03-10 16:32:06 +01:00
parent a972f38bb6
commit 08c39a2bd8
3 changed files with 142 additions and 5 deletions

View File

@@ -144,6 +144,20 @@ type metadata for the different types is as follows:
11b ; 64 bit
```
#### `opcodes.by_id`
entries are as follows:
```
+----------+--------+----------+
| 31 24 | 23 16 | 15 0 |
+----------+--------+----------+
| reserved | opcode | token ID |
+----------+--------+----------+
```
note the lack of support for multiple-byte opcodes or multiple opcodes for one token ID; these features will likely be added at some point after the parser accumulates too much jank.
### token IDs
supported tokens are listed below