From 244072db39c1f6fa743fec38463f550f1b9608c4 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 24 Sep 2026 17:26:07 -0700 Subject: "include" works under the hex transform now 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 --- transform.e | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'transform.e') 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 -- cgit 1.4.1