about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-06 00:41:20 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-06 00:41:20 -0700
commitb8fd119b784e1eda55462a587851cadf56f61700 (patch)
treeadb84760706e55d4c81409de18f967949d739eb5 /apps
parentce094a5d827b82c48eb76b1b4c04cf899219c33b (diff)
downloadmu-b8fd119b784e1eda55462a587851cadf56f61700.tar.gz
6969
Fix and cleanup.
Diffstat (limited to 'apps')
-rw-r--r--apps/tile/data.mu11
-rw-r--r--apps/tile/main.mu18
2 files changed, 5 insertions, 24 deletions
diff --git a/apps/tile/data.mu b/apps/tile/data.mu
index beceb7c7..e913a369 100644
--- a/apps/tile/data.mu
+++ b/apps/tile/data.mu
@@ -206,9 +206,9 @@ fn populate-text-with _out: (addr handle array byte), _in: (addr array byte) {
 }
 
 fn find-in-call-path in: (addr handle call-path), needle: (addr handle call-path-element) -> result/eax: boolean {
-$find-in-call-path:body: {
   var curr-ah/esi: (addr handle call-path) <- copy in
-  {
+  var out/edi: boolean <- copy 0  # false
+  $find-in-call-path:loop: {
     var curr/eax: (addr call-path) <- lookup *curr-ah
     compare curr, 0
     break-if-=
@@ -218,15 +218,14 @@ $find-in-call-path:body: {
       compare match?, 0  # false
       {
         break-if-=
-        result <- copy 1  # true
-        break $find-in-call-path:body
+        out <- copy 1  # true
+        break $find-in-call-path:loop
       }
     }
     curr-ah <- get curr, next
     loop
   }
-  result <- copy 0  # false
-}
+  result <- copy out
 }
 
 fn call-path-element-match? _x: (addr handle call-path-element), _y: (addr handle call-path-element) -> result/eax: boolean {
diff --git a/apps/tile/main.mu b/apps/tile/main.mu
index 642d1621..c4a5f6c0 100644
--- a/apps/tile/main.mu
+++ b/apps/tile/main.mu
@@ -44,30 +44,12 @@ fn main args-on-stack: (addr array addr array byte) -> exit-status/ebx: int {
 }
 
 fn interactive {
-#?   var elem: (handle call-path-element)
-#?   var elem-addr/ebx: (addr handle call-path-element) <- address elem
-#?   allocate elem-addr  # leak
-#?   var path: (handle call-path)
-#?   var path-addr/eax: (addr handle call-path) <- address path
-#?   allocate path-addr
-#?   var dummy/eax: boolean <- find-in-call-path path-addr, elem-addr
   enable-screen-grid-mode
   enable-keyboard-immediate-mode
   var env-storage: environment
   var env/esi: (addr environment) <- address env-storage
   initialize-environment env
   draw-screen env
-#?   var key/eax: grapheme <- copy 0x31  # '1'
-#?   process env, key
-#?   key <- copy 0x20  # space
-#?   process env, key
-#?   key <- copy 0x32  # '2'
-#?   process env, key
-#?   key <- copy 0x2a  # '*'
-#?   process env, key
-#?   key <- copy 0xa  # newline
-#?   process env, key
-#?   render env
   {
     var key/eax: grapheme <- read-key-from-real-keyboard
     compare key, 0x71  # 'q'