diff options
Diffstat (limited to 'transform.e')
| -rw-r--r-- | transform.e | 13 |
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 |