summary refs log tree commit diff
path: root/transform.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-19 00:38:46 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-19 00:38:46 -0700
commitebd8be68201201fd86fc4a4e4e0a535738af86bd (patch)
treef609d37f12d58ba4dbb5f2a3551cd9344b974c86 /transform.e
parenteec336dea3d86e176c4bd86c435e6be35fec64e2 (diff)
yessssssss
so okay, now all the machine code stuff is implemented and it builds without crashing

the generated executable still crashes though, but this was enough work that it's getting a celebratory check-in

Force-Push: yes
Change-Id: I201e6912253647da58ef3537c735b478b0dca9fb
Diffstat (limited to 'transform.e')
-rw-r--r--transform.e20
1 files changed, 20 insertions, 0 deletions
diff --git a/transform.e b/transform.e
index 7f3d9ef..0c39489 100644
--- a/transform.e
+++ b/transform.e
@@ -410,6 +410,24 @@ allocate-transform-state s" transform-state" variable
   ; make-immediate
 
 
+~ TODO there should really be an actual word that this alternate is replacing
+~
+~ (string pointer --)
+: label-keyword-alternate
+  Lcreate
+
+  here @ dup
+  ~ (self execution token, output point)
+  dup 8 + pack64
+  swap :rax mov-reg64-imm64
+  ~ (output point)
+  :rax push-reg64
+  pack-next
+  8 packalign
+  here !
+  ; make-immediate
+
+
 ~   Because docol requires it, we provide a special mini-version of the label
 ~ system. We only do L@' and L!', because that's all we need. These are real
 ~ labels; there can be arbitrarily many of them, and they can have forward
@@ -482,6 +500,8 @@ allocate-transform-state s" transform-state" variable
   dup s" ;asm" stringcmp 0 = { swap drop ' L;asm swap } if
   dup s" L@'" stringcmp 0 = { swap drop ' label-L@'-alternate swap } if
   dup s" L!'" stringcmp 0 = { swap drop ' label-L!'-alternate swap } if
+  dup s" keyword" stringcmp 0 = {
+    swap drop ' label-keyword-alternate swap } if
   drop swap
   ~ (name as stack string, 0 or alternate entry pointer, name pointer)