summary refs log tree commit diff
path: root/transform.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-08-28 22:50:12 -0700
committerIrene Knapp <ireneista@irenes.space>2026-08-28 22:50:12 -0700
commitd8b1020847a214f73e1f5109a50e593a3e623daa (patch)
treef0fa7ce2330756f4bd5894f6d3aaec0a974a531c /transform.e
parenta41c6444d30f9ad561d95a1776f796581338df16 (diff)
remove the hardcoded magic word from the hex transform also
now there is no hardcoding of it anywhere

Force-Push: yes
Change-Id: Iaacbfb5fa07ded7e48075ba59f0bfdb9f9252cf4
Diffstat (limited to 'transform.e')
-rw-r--r--transform.e13
1 files changed, 7 insertions, 6 deletions
diff --git a/transform.e b/transform.e
index ff37ea6..e7a8506 100644
--- a/transform.e
+++ b/transform.e
@@ -2952,7 +2952,8 @@ allocate-transformation-state s" transformation-state" variable
   value@
 
   ~ If it's the magic word, end the transformation.
-  dup s" pyrzqxgl" stringcmp 0 = { drop dropstring 1 exit } if
+  dup transformation-state transformation-state-delimiter @ stringcmp 0 =
+  { drop dropstring 1 exit } if
 
   ~   Check whether it's one of the words we have alternates for, and look up
   ~ the alternate if so.
@@ -3121,12 +3122,11 @@ allocate-transformation-state s" transformation-state" variable
 ~ an input string. It is directly analogous to "quit", in interpret.e, but is
 ~ more complex.
 ~
-~ (output buffer start, output point, input string pointer
+~ (output buffer start, output point, input string pointer, delimiter pointer
 ~  -- output buffer start, output point)
 : hex-transform
   main-input-buffer dup push-input-buffer
-  ~ TODO the arguments for this seem to be backwards from the documentation
-  swap attach-string-to-input-buffer
+  3roll attach-string-to-input-buffer
 
   ~   Save the old values of "here" and "latest", and set the initial values
   ~ of the internal ones. These values need to persist across iterations,
@@ -3138,10 +3138,11 @@ allocate-transformation-state s" transformation-state" variable
   ~ user-stack-depth fields of transformation-state.
   here @ transformation-state transformation-state-saved-here !
   latest @ transformation-state transformation-state-saved-latest !
-  over transformation-state transformation-state-output-buffer-start !
+  2 pick transformation-state transformation-state-output-buffer-start !
   0 transformation-state transformation-state-user-stack-depth !
-  here !
+  swap here !
   0 latest !
+  transformation-state transformation-state-delimiter !
   ~ Now the stack has nothing of ours on it, so client code can do its thing.
 
   ~   It's important that the stack has nothing of ours on it that persists