From c5e1cbc4ce5135140f460f72f91fdd321de9f3c6 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 27 Oct 2020 20:51:28 -0700 Subject: 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. --- apps/tile/rpn.mu | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apps/tile/rpn.mu') 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 { -- cgit 1.4.1-2-gfad0