about summary refs log tree commit diff stats
path: root/shell/data.limg
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-07 09:49:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-07 09:49:16 -0700
commit74be534e2be007f0729092c49a90ca8e410150a8 (patch)
treebde87d2626b3274db039e87adbb38cd7f1813e01 /shell/data.limg
parent7105b73fd3f0952a62de125ee70fe81a9ae683fd (diff)
downloadmu-74be534e2be007f0729092c49a90ca8e410150a8.tar.gz
starting to implement first macros
Another commit, another bugfix.

Some snippets from my currently exploding todo list:

- always investigate lookup errors immediately. Beyond the root cause, they should never happen at the moment, while we aren't reclaiming memory.
  we should always return a more precise error message. Usually involving null pointer checks.

- on abort, print out stack trace
  - emit mapping of labels to addresses during survey
  - store a mapping of symbols somewhere in the code image

- stop allocating 1KB per token; expand space for tokens as needed
Diffstat (limited to 'shell/data.limg')
-rw-r--r--shell/data.limg4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/data.limg b/shell/data.limg
index 14eab44e..b3750892 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -1,5 +1,9 @@
 (
   (globals . (
+    (mac . [(def mac (litmac litfn () (name params . body)
+  `(def ,name (litmac litfn () ,params ,@body))))])
+    (when . [(mac when (cond body)
+  `(if ,cond ,body ()))])
     (hline . [(def hline (fn (screen y color)
   (hline1 screen y 0 (width screen) color)))])
     (hline1 . [(def hline1 (fn (screen y lo hi color)