From 6474c2f22764a4741104d86262487b002c0aea3a Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Fri, 27 Feb 2026 19:51:34 +0000 Subject: [PATCH] Logically flip SPACE? to NSPACE WORD was using it like this, and it's easier to fix it this way rather than insert an INVERT into WORD. --- wipforth.wat | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/wipforth.wat b/wipforth.wat index fc6bf04..556e0ef 100644 --- a/wipforth.wat +++ b/wipforth.wat @@ -1105,39 +1105,39 @@ ;; => 0x1c bytes - ;; : SPACE? ( byte -- bool ) - ;; DUP 9 = SWAP \ Compare to horizontal tab - ;; DUP 10 = SWAP \ Compare to line-feed - ;; DUP 13 = SWAP \ Compare to carriage return - ;; 32 = \ Compare to space - ;; OR OR OR \ Or all results together + ;; : NSPACE ( byte -- bool ) + ;; DUP 9 <> SWAP \ Compare to horizontal tab + ;; DUP 10 <> SWAP \ Compare to line-feed + ;; DUP 13 <> SWAP \ Compare to carriage return + ;; 32 <> \ Compare to space + ;; AND AND AND \ And all results together ;; ; (data (i32.const 0x0600) "\e4\05\00\00" - "\06SPACE?\00" + "\06NSPACE\00" "\00\00\00\00" "\08\02\00\00" ;; DUP "\18\04\00\00" ;; LIT "\09\00\00\00" ;; 9 - "\fc\02\00\00" ;; = + "\08\03\00\00" ;; <> "\28\02\00\00" ;; SWAP "\08\02\00\00" ;; DUP "\18\04\00\00" ;; LIT "\0a\00\00\00" ;; 10 - "\fc\02\00\00" ;; = + "\08\03\00\00" ;; <> "\28\02\00\00" ;; SWAP "\08\02\00\00" ;; DUP "\18\04\00\00" ;; LIT "\0d\00\00\00" ;; 13 - "\fc\02\00\00" ;; = + "\08\03\00\00" ;; <> "\28\02\00\00" ;; SWAP "\18\04\00\00" ;; LIT "\20\00\00\00" ;; 32 - "\fc\02\00\00" ;; = - "\98\03\00\00" ;; OR - "\98\03\00\00" ;; OR - "\98\03\00\00" ;; OR + "\08\03\00\00" ;; <> + "\8c\03\00\00" ;; AND + "\8c\03\00\00" ;; AND + "\8c\03\00\00" ;; AND "\0c\04\00\00") ;; EXIT ;; => 0x68 bytes @@ -1146,7 +1146,7 @@ ;; 0 \ Initial length ;; ;; KEY \ Get byte from input - ;; TUCK SPACE? 0BRANCH [60] \ Check if whitespace + ;; TUCK NSPACE 0BRANCH [60] \ Check if whitespace ;; TUCK WORDBUF + C! \ Append byte to WORDBUF ;; 1+ \ Increment length ;; DUP 32 >= 0BRANCH [8] EXIT \ Exit if at max length @@ -1165,7 +1165,7 @@ "\00\00\00\00" ;; 0 "\84\04\00\00" ;; KEY "\f0\05\00\00" ;; TUCK - "\0c\06\00\00" ;; SPACE? + "\0c\06\00\00" ;; NSPACE "\b4\04\00\00" ;; 0BRANCH "\3c\00\00\00" ;; 60 "\f0\05\00\00" ;; TUCK