summaryrefslogtreecommitdiff
path: root/sanctuary.fs
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-04-21 18:39:25 +1000
committerkitty <nepeta@canaglie.net>2026-04-21 18:39:25 +1000
commitd86eafae2f8f80ce417b29a3f4b5f98ab82be2b2 (patch)
tree07cf6ec4454c0e12677db7974aaa6d15505998c8 /sanctuary.fs
parent2778c7d8c90cde9dd67c2aa07b62f65ee8ec3838 (diff)
fix search-wordlist, more tests again
i think thats enough tests for now maybe also maybe i should separate test.fs into a test dir with multiple files? next point of order is .s words and dump at some point also i need to do case stuff. maybe that should be first? also i want dump to have term colours like jewelforth's one has which is a good opportunity to actually use the vocabulary functionatily. bit more ambitious, but i also want to add line editing stuff. i'm worried this will mean fucking around with input again though. also i want to include a startup timer. running the whole testing suite is about 0.035s which is Alright i think, i'd like more detailed stats than `time` gives though. i don't think speed matters too much though
Diffstat (limited to 'sanctuary.fs')
-rw-r--r--sanctuary.fs9
1 files changed, 7 insertions, 2 deletions
diff --git a/sanctuary.fs b/sanctuary.fs
index 9ea7a5a..70bc8cf 100644
--- a/sanctuary.fs
+++ b/sanctuary.fs
@@ -453,13 +453,18 @@ defer default-wordlist
forth-wordlist (vocabulary) forth
-1 set-order
+: visible? ( ht -- ? ) >ffa c@ 1 and 0= ;
+
+\ todo handle smudge
: search-wordlist ( a u wid -- 0 | ht -1 )
( wid ) @ begin ( a u ht )
>r 2dup r@ ( a u a u ht ; backup str for next loop )
>nfa count ( a1 u1 a2 u2 )
compare 0= if
- 2drop ( drop backup )
- r> -1 exit
+ r@ visible? if
+ 2drop ( drop backup )
+ r> -1 exit
+ then
then
r> @ ?dup 0=
until