about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-24 20:44:13 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-24 20:44:13 -0700
commita04f816cff4a2a558a522b859f8339637db6b726 (patch)
treec71cb553e4d6fcbdf4e23bbd719ba26133cdcd4f /apps
parentb27a1a2523ed0733329832b7010a7939e3b72114 (diff)
downloadmu-a04f816cff4a2a558a522b859f8339637db6b726.tar.gz
6852 - tile: placeholder for lexical scopes
Diffstat (limited to 'apps')
-rw-r--r--apps/tile/data.mu10
-rw-r--r--apps/tile/environment.mu2
-rw-r--r--apps/tile/rpn.mu2
3 files changed, 12 insertions, 2 deletions
diff --git a/apps/tile/data.mu b/apps/tile/data.mu
index 44d9b2d6..bdd42ce5 100644
--- a/apps/tile/data.mu
+++ b/apps/tile/data.mu
@@ -40,6 +40,16 @@ type value {
   box-data: (handle line)
 }
 
+type bind {
+  key: (handle array byte)
+  value: value
+}
+
+type table {
+  data: (handle array bind)
+  next: (handle table)
+}
+
 #? type result {
 #?   data: (handle value-stack)
 #?   error: (handle array byte)  # single error message for now
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu
index 73d97de5..a52db8b8 100644
--- a/apps/tile/environment.mu
+++ b/apps/tile/environment.mu
@@ -238,7 +238,7 @@ fn render-column screen: (addr screen), defs: (addr function), scratch: (addr li
     var stack: int-stack
     var stack-addr/edi: (addr int-stack) <- address stack
     initialize-int-stack stack-addr, 0x10  # max-words
-    evaluate defs, scratch, final-word, stack-addr
+    evaluate defs, 0, scratch, final-word, stack-addr
     # render stack
     var curr-row/edx: int <- copy top-row
     curr-row <- add 3  # stack-margin-top
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index 79339918..4f9a926c 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -1,4 +1,4 @@
-fn evaluate defs: (addr function), scratch: (addr line), end: (addr word), out: (addr int-stack) {
+fn evaluate defs: (addr function), bindings: (addr table), scratch: (addr line), end: (addr word), out: (addr int-stack) {
   var line/eax: (addr line) <- copy scratch
   var word-ah/eax: (addr handle word) <- get line, data
   var curr/eax: (addr word) <- lookup *word-ah