diff options
Diffstat (limited to 'transform.e')
| -rw-r--r-- | transform.e | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/transform.e b/transform.e index f8a4ee4..fc6e69e 100644 --- a/transform.e +++ b/transform.e @@ -3,6 +3,7 @@ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ ~ TODO explain what problem this is solving and why +~ The process of ~ ~ The label transform operates on code that compiles itself, and ensures ~ that the result of the compilation is suitable to be included in an @@ -300,10 +301,10 @@ allocate-transform-state s" transform-state" variable ~ analogous to "interpret", and reading interpret.e may help in understanding ~ it, though it's meant to still make sense on its own. ~ -~ It expects to be called from "transform", below, which loops. +~ It expects to be called from "label-transform", below, which loops. ~ ~ (-- done) -: transform-one +: label-transform-one word ~ If no word was returned, exit. @@ -344,7 +345,7 @@ allocate-transform-state s" transform-state" variable ~ word. First check whether we have an immediate entry, then if so, check ~ that entry's flags. Notice that this means the generated code can't ~ override an immediate word with a non-immediate word of the same name. - over dup { entry-flags@ 0x01 & not } if + over dup { entry-flags@ 0x01 & not } { not } if-else { ~ Either there was no immediate entry, or the immediate entry wasn't @@ -445,7 +446,7 @@ allocate-transform-state s" transform-state" variable ~ ~ (output buffer start, output point, input string pointer ~ -- output buffer start, output point) -: transform +: label-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 @@ -465,7 +466,7 @@ allocate-transform-state s" transform-state" variable ~ It's important that the stack has nothing of ours on it that persists ~ across iterations, so that client code can add and remove stuff there as ~ it sees fit. - { transform-one + { label-transform-one ~ (done) ~ When the loop is done, get the real values of "here" and "latest" |