From a41c6444d30f9ad561d95a1776f796581338df16 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 28 Aug 2026 22:21:52 -0700 Subject: make read-to-buffer take its delimiter as a parameter since the recommended invocation to build Evocation (hehe) does the heavy lifting in interpreted mode, this required a new helper, allocate-string, which takes a string in the scratch space and properly allocates it so it won't be overwritten by future allocations Force-Push: yes Change-Id: Ia73612a65fd7c11af5fe110c573c23c16b777112 --- transform.e | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'transform.e') 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 -- cgit 1.4.1