about summary refs log tree commit diff stats
path: root/apps/tile/rpn.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-27 20:51:28 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-27 20:51:28 -0700
commitc5e1cbc4ce5135140f460f72f91fdd321de9f3c6 (patch)
tree6b9839bfd920fb5c3cfe02ab23f60101f2ab009f /apps/tile/rpn.mu
parent603b4c47ddb25596e262e0f7598f9c3c0a89cc49 (diff)
downloadmu-c5e1cbc4ce5135140f460f72f91fdd321de9f3c6.tar.gz
7129 - tile: allow bindings anywhere
Amazing how easy this was. And it does feel more intuitive. If I decide
at some point that I want to bind something to a name I don't usually want
to lose the entire line after that point.

It also sidesteps for now the thorny question of whether to permit organically
switching to a new line (rather than using the 'name value' hotkey), and
how that should work.
Diffstat (limited to 'apps/tile/rpn.mu')
-rw-r--r--apps/tile/rpn.mu14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index e45aa3d7..e2c7aeef 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -279,13 +279,6 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         var key/ecx: (addr handle array byte) <- address key-h
         stream-to-array curr-stream, key
         bind-in-table bindings, key, target-val
-        # process next line if necessary
-        var line/eax: (addr line) <- copy scratch
-        var next-line-ah/eax: (addr handle line) <- get line, next
-        var next-line/eax: (addr line) <- lookup *next-line-ah
-        compare next-line, 0
-        break-if-= $evaluate:process-word
-        evaluate functions, bindings, next-line, end, out
         break $evaluate:process-word
       }
       rewind-stream curr-stream
@@ -444,6 +437,13 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
     #
     loop
   }
+  # process next line if necessary
+  var line/eax: (addr line) <- copy scratch
+  var next-line-ah/eax: (addr handle line) <- get line, next
+  var next-line/eax: (addr line) <- lookup *next-line-ah
+  compare next-line, 0
+  break-if-=
+  evaluate functions, bindings, next-line, end, out
 }
 
 fn test-evaluate {