From d8b1020847a214f73e1f5109a50e593a3e623daa Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 28 Aug 2026 22:50:12 -0700 Subject: remove the hardcoded magic word from the hex transform also now there is no hardcoding of it anywhere Force-Push: yes Change-Id: Iaacbfb5fa07ded7e48075ba59f0bfdb9f9252cf4 --- transform.e | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'transform.e') 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 -- cgit 1.4.1