Implement new string functions (#1655)

`STRFIND`, `STRRFIND`, `STRCHAR`, `STRSLICE`, `CHARCMP`, `CHARSIZE`, and `REVCHAR`
This commit is contained in:
Rangi
2025-02-14 23:09:45 +01:00
committed by GitHub
parent ad4d9da4cf
commit 3feb75f84f
27 changed files with 584 additions and 134 deletions

23
test/asm/revchar.asm Normal file
View File

@@ -0,0 +1,23 @@
charmap "a", 1
charmap "b", 2
charmap "c", 3
charmap "d", 3
charmap "eeeee", $12345678
charmap "x", 1, 2, 3
charmap "y", 4, 5, 6, 7, 8, $99999999
charmap "zed", $1234, $5678, $9abc, $def0
macro test
redef expected equs \1
shift
assert !strcmp(revchar(\#), "{expected}")
endm
test "a", 1
test "b", 2
test "eeeee", 305419896
test "x", 1, 2, 3
test "y", 4, 5, 6, 7, 8, $99999999
test "zed", 4660, 22136, 39612, 57072
test "", 3 ; multiple
test "", 4 ; none