diff options
Diffstat (limited to 'transform.e')
| -rw-r--r-- | transform.e | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/transform.e b/transform.e index 313882d..ff37ea6 100644 --- a/transform.e +++ b/transform.e @@ -203,7 +203,7 @@ ~ implementations of both transforms. ~ TODO all this buffer stuff should be in its own file -~ (buffer size -- buffer address) +~ (delimiter pointer, buffer size -- buffer address) : read-to-buffer dup allocate dup dup ~ (buffer size, buffer address, word start, output point) @@ -212,7 +212,7 @@ dup not { ~ Make sure to pack the zero to serve as a null terminator. pack8 - drop drop swap drop exit } if + drop drop swap drop swap drop exit } if dup is-space { ~ (buffer size, buffer address, word start, output point, key) ~ Tuck the key out of the way until we've done some stuff. @@ -224,12 +224,12 @@ ~ Add a null terminator so we can use stringcmp dup 0 swap ! ~ Check for the magic word - over s" pyrzqxgl" stringcmp 0 = + over 6 pick stringcmp 0 = } if { ~ It's magic, so exit. ~ Make sure to pack a zero to serve as a null terminator. 0 pack8 - drop drop drop swap drop exit } + drop drop drop swap drop swap drop exit } { ~ It's not magic, so reset the word start. Of course whitespace is ~ not a word but this will help us keep track of things. 3roll pack8 |