about summary refs log tree commit diff stats
path: root/lambda-to-mu.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-07-22 20:34:29 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-07-22 20:34:29 -0700
commite05a50bcdd6307fa5da55e34e18c7ceac3567314 (patch)
treea39f3b45f2dddb0c406d40c1031fa7283248fcd1 /lambda-to-mu.mu
parent050a93aca8840087b702dbd5b39565f56da00569 (diff)
downloadmu-e05a50bcdd6307fa5da55e34e18c7ceac3567314.tar.gz
3132
Diffstat (limited to 'lambda-to-mu.mu')
-rw-r--r--lambda-to-mu.mu40
1 files changed, 19 insertions, 21 deletions
diff --git a/lambda-to-mu.mu b/lambda-to-mu.mu
index 1c564db7..d4dc4739 100644
--- a/lambda-to-mu.mu
+++ b/lambda-to-mu.mu
@@ -135,32 +135,30 @@ def parse in:address:array:character -> out:address:cell [
 def parse in:address:stream -> out:address:cell, in:address:stream [
   local-scope
   load-ingredients
+  c:character <- peek in
+  pair?:boolean <- equal c, 40/open-paren
   {
-    done?:boolean <- end-of-stream? in
-    break-if done?
-    c:character <- peek in
-    pair?:boolean <- equal c, 40/open-paren
+    break-if pair?
+    # atom
+    b:address:buffer <- new-buffer 30
     {
-      break-if pair?
-      # atom
-      b:address:buffer <- new-buffer 30
-      {
-        done?:boolean <- end-of-stream? in
-        break-if done?
-        c:character, in <- read in
-        b <- append b, c
-        loop
-      }
-      s:address:array:character <- buffer-to-array b
-      out <- new-atom s
+      done?:boolean <- end-of-stream? in
+      break-if done?
+      c:character, in <- read in
+      b <- append b, c
+      loop
     }
+    s:address:array:character <- buffer-to-array b
+    out <- new-atom s
+    reply
+  }
+  {
+    break-unless pair?
+    # pair
+    read in  # skip the open-paren
     {
-      break-unless pair?
-      # pair
-      out <- new-pair 0, 0
+#?       done?:boolean <- 
     }
-    c:character, in <- read in
-    loop
   }
 ]