about summary refs log tree commit diff
path: root/transform.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-09-24 17:26:07 -0700
committerIrene Knapp <ireneista@irenes.space>2026-09-24 17:26:07 -0700
commit244072db39c1f6fa743fec38463f550f1b9608c4 (patch)
tree278a35e9b0c994367d6730fa8232e6c7a809d2b6 /transform.e
parent3b565483d9fbf6454d6d0e79a4e8fe1ae6c9eace (diff)
"include" works under the hex transform now HEAD main
this means all the build invocations are now as simple as they can be without new abstractions of some sort, such as letting evoke take command-line parameters. yay!

Force-Push: yes
Change-Id: Id877159f995662b8d226a9ad937ed73228a9af05
Diffstat (limited to 'transform.e')
-rw-r--r--transform.e30
1 files changed, 30 insertions, 0 deletions
diff --git a/transform.e b/transform.e
index 3c844b6..4c550e1 100644
--- a/transform.e
+++ b/transform.e
@@ -6174,6 +6174,34 @@ allocate-transformation-state s" transformation-state" variable
   } if-else ; make-immediate
 
 
+~   This runs instead of "interpret" in code under the hex transform. The
+~ proximate effect of that is to make "include" work. Note, however, that this
+~ replacement only applies directly under the hex transform. It isn't a
+~ sensible approach under the log-load transform at all, and under the label
+~ transform it would have such strange behavior that it isn't a good idea
+~ either.
+: hex-interpret-replacement
+  ~ This is a forward reference, so we need to look it up.
+  s" hex-transform-one"
+  swap-transform-variables find swap-transform-variables
+  entry-to-execution-token execute
+
+  ~   We ignore the EOF indication, on the assumption something else will
+  ~ detect it and return to the outer loop, the one that's ours. For example,
+  ~ look at "include", in files.e.
+  drop ;
+
+
+~   This installs hex-interpret-replacement, compiling it in compile mode and
+~ executing it in immediate mode.
+: hex-interpret-alternate
+  interpreter-flags @ 0x01 & {
+    ' hex-interpret-replacement entry-to-execution-token ,
+  } {
+    hex-interpret-replacement
+  } if-else ; make-immediate
+
+
 ~   This implements the hex transform for a single word. It is directly
 ~ analogous to "interpret", and reading interpret.e may help in understanding
 ~ it, though it's meant to still make sense on its own.
@@ -6247,6 +6275,8 @@ allocate-transformation-state s" transformation-state" variable
   dup s" memmove" stringcmp 0 = { swap drop ' hex-memmove-alternate swap } if
   dup s" word" stringcmp 0 = { swap drop ' hex-word-alternate swap } if
   dup s" ~" stringcmp 0 = { swap drop ' hex-tilde-alternate swap } if
+  dup s" interpret" stringcmp 0 = {
+    swap drop ' hex-interpret-alternate swap } if
   ~ (name as stack string, 0 or alternate entry pointer, name pointer)
 
   find