summary refs log tree commit diff
path: root/interpret.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-09-18 15:12:50 -0700
committerIrene Knapp <ireneista@irenes.space>2026-09-18 15:12:50 -0700
commit31509055e11946ecc118ebbc6f72e458b17de918 (patch)
tree88c56d9bb9500526ca1912f38117675d2dfccdbb /interpret.e
parentf7710d4de0626fb1ecbdfea2933198a494bfb77b (diff)
magic comments for a bunch more small stuff
especially in the label-transform output

there's more to do, but there are additional magic-comment features that would be handy, so we're checking this in now so that those can be cleanly kept in their own CL

Force-Push: yes
Change-Id: I97a67caddc3f3150c349b7956c1d715db909d1a9
Diffstat (limited to 'interpret.e')
-rw-r--r--interpret.e20
1 files changed, 15 insertions, 5 deletions
diff --git a/interpret.e b/interpret.e
index c1d88c4..92b2035 100644
--- a/interpret.e
+++ b/interpret.e
@@ -407,8 +407,14 @@ latest @
 
 ~   The counterpart of : is ;.
 : ;
-  ~ See commentary on "literal", in dynamic.e, regarding "lit exit".
-  lit exit ,
+  ~   See commentary on "literal", in dynamic.e, regarding "lit exit".
+  ~
+  ~   In regard to the magic comment, this is in the same category as strings
+  ~ and high-level flow control, where it's implemented in the base code here
+  ~ because that could be relevant to end-user code that compiles things
+  ~ without using the transforms, but in the regular compiler it's not used
+  ~ because the transforms override this whole implementation.
+  lit exit , ~ : -8 exit    (codeword pointer)
   make-visible
   ~   See above regarding [. Since it's an immediate word, we have to go to
   ~ extra trouble to compile it as part of ;. Since it's also hidden, we have
@@ -457,7 +463,10 @@ latest @
   consume
   interpreter-flags @ 0x01 & {
     [ s" litstring" find literal ]
-    entry-to-execution-token ,
+    ~   The magic comment isn't active in the compiler as-written, since the
+    ~ transformations do this bit themselves, but should still be here for
+    ~ completeness; it could affect other things people compile.
+    entry-to-execution-token , ~ : -8 litstring    (codeword pointer)
   } if
   here @ key { dup dup 0x22 != && } { pack8 key } while
   drop 0 pack8
@@ -472,8 +481,9 @@ latest @
   ' s" entry-to-execution-token execute
   interpreter-flags @ 1 &
     { [ s" emitstring" find literal ]
-      entry-to-execution-token , }
-    { emitstring } if-else
+      ~ As with s", the magic comment is for completeness only.
+      entry-to-execution-token , ~ : -8 emitstring    (codeword pointer)
+    } { emitstring } if-else
   ; make-immediate