String Instructions
All checks were successful
per-push tests / build (push) Successful in 47s
per-push tests / test-utility (push) Successful in 53s
per-push tests / test-frontend (push) Successful in 59s
per-push tests / test-backend (push) Successful in 43s
per-push tests / timed-decomposer-parse (push) Successful in 51s

The following instructions are modified to act on strings:
- INDEX: Now pulls a char out at index
- SUBSL: Now pulls a substring out of a source string
- INSER: Now inserts a char into a string at index
- LENGTH: Now returns length of a string

In addition to the above instructions, additional instructions
are now implemented to handle strings:
- CONCAT: appends a string onto another string
- S_APPEND: appends a char on to the end of a string

Fixes: #38

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2025-07-29 18:16:10 +00:00
parent 63554191f8
commit ddb49788af
3 changed files with 81 additions and 43 deletions

View file

@ -17,7 +17,6 @@
use core::ops::{Index, Deref, DerefMut};
use core::ptr::NonNull;
use core::cell::RefCell;
use alloc::rc::Rc;
use alloc::vec::Vec;
@ -141,8 +140,8 @@ pub enum Datum {
Symbol(String),
Char(u8),
String(Vec<u8>),
Vector(RefCell<Vec<Gc<Datum>>>),
ByteVector(RefCell<Vec<u8>>),
Vector(Vec<Gc<Datum>>),
ByteVector(Vec<u8>),
None
}