about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-24 18:56:15 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-24 18:56:15 -0800
commit89b17724fe88909c7a256db259abcc82ca1abf40 (patch)
tree000838f7c40507d00f33e489eea31cbbce2de6d2
parentd69fd246f2a20fe2f9ccd075281072f22b5a8a0e (diff)
downloadmu-89b17724fe88909c7a256db259abcc82ca1abf40.tar.gz
312
-rw-r--r--mu.arc16
-rw-r--r--mu.arc.t11
2 files changed, 20 insertions, 7 deletions
diff --git a/mu.arc b/mu.arc
index b52f50f3..3200b073 100644
--- a/mu.arc
+++ b/mu.arc
@@ -838,15 +838,17 @@
 (def convert-quotes (instrs)
   (let deferred (queue)
     (each instr instrs
-      (case instr.0
-        defer
-          (let (q qinstrs)  instr.1
-            (assert (is 'make-br-fn q) "defer: first arg must be [quoted]")
-            (each qinstr qinstrs
-              (enq qinstr deferred)))))
+      (when (acons instr)
+        (case instr.0
+          defer
+            (let (q qinstrs)  instr.1
+              (assert (is 'make-br-fn q) "defer: first arg must be [quoted]")
+              (each qinstr qinstrs
+                (enq qinstr deferred))))))
     (accum yield
       (each instr instrs
-        (unless (in instr.0 'defer)  ; keep sync'd with case clauses above
+        (unless (and acons.instr
+                     (in instr.0 'defer))  ; keep sync'd with case clauses above
           (yield instr)))
       (each instr (as cons deferred)
         (yield instr)))))
diff --git a/mu.arc.t b/mu.arc.t
index 4000967f..447811a5 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2425,4 +2425,15 @@
             ((3 integer) <- copy (6 literal))))
   (prn "F - convert-quotes can handle 'defer'"))
 
+(reset)
+;? (new-trace "convert-quotes-label")
+(if (~iso (convert-quotes
+            '(((1 integer) <- copy (4 literal))
+              foo
+              ((2 integer) <- copy (5 literal))))
+          '(((1 integer) <- copy (4 literal))
+            foo
+            ((2 integer) <- copy (5 literal))))
+  (prn "F - convert-quotes can handle labels"))
+
 (reset)  ; end file with this to persist the trace for the final test