VM Bytecode char to string instructions
All checks were successful
per-push tests / build (push) Successful in 3m17s
per-push tests / test-frontend (push) Successful in 1m11s
per-push tests / test-utility (push) Successful in 2m10s
per-push tests / test-backend (push) Successful in 1m52s
per-push tests / timed-decomposer-parse (push) Successful in 1m39s

New instrucions: CTOS and MKSTR. CTOS creates a string containing
a single (input) character. MKSTR creates a new blank string. Unit
tests included.

fixes: #42

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2025-08-09 05:23:45 +00:00
parent e310b901c3
commit f48867db42
2 changed files with 45 additions and 13 deletions

View file

@ -1,3 +1,13 @@
# TODO: add the following info
# - introductory VM info (description, list of components)
# - info on the different data types
# - info on garbage collection
# - info on program execution
# - info on error handling
# - info on traps
# - info on numbers
# - info on symtable (and its uses)
[[addressing_modes]]
name = "expr"
mutable = true
@ -275,6 +285,12 @@ args = ["src"]
output = ""
description = "decrements number at source"
[[instructions]]
name = "ctos"
args = ["src"]
output = ""
description = "mutates a char datum into a string datum"
[[instructions]]
name = "cton"
args = ["src"]
@ -317,6 +333,12 @@ args = []
output = "a blank bytevector"
description = "creates a blank bytevector"
[[instructions]]
name = "mkstr"
args = []
output = "an empty string"
description = "creates a new empty string"
[[instructions]]
name = "index"
args = ["collection", "index"]