about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-22 22:26:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-22 22:26:11 -0800
commit1ced22ded92c30794a47c208f281f2849ae28a59 (patch)
tree783e29d1a3711f556e498f9876adb93bc24d4011 /mu.arc.t
parent69ed99172ca66f6a15eb90938811aa8fdb8b69c5 (diff)
downloadmu-1ced22ded92c30794a47c208f281f2849ae28a59.tar.gz
299 - labels inside functions
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t44
1 files changed, 38 insertions, 6 deletions
diff --git a/mu.arc.t b/mu.arc.t
index eb51b4c6..975afe7d 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1229,6 +1229,34 @@
   (prn "F - convert-braces balances curlies when converting continue"))
 
 (reset)
+(new-trace "convert-braces-label")
+(if (~iso (convert-braces
+            '(((1 integer) <- copy (4 literal))
+              foo
+              ((2 integer) <- copy (2 literal))))
+          '(((1 integer) <- copy (4 literal))
+            foo
+            ((2 integer) <- copy (2 literal))))
+  (prn "F - convert-braces skips past labels"))
+;? (quit)
+
+(reset)
+(new-trace "convert-braces-label-increments-offset")
+(if (~iso (convert-braces
+            '(((1 integer) <- copy (4 literal))
+              { begin
+                (break)
+                foo
+              }
+              ((2 integer) <- copy (2 literal))))
+          '(((1 integer) <- copy (4 literal))
+            (jump (1 offset))
+            foo
+            ((2 integer) <- copy (2 literal))))
+  (prn "F - convert-braces skips past labels"))
+;? (quit)
+
+(reset)
 (new-trace "continue")
 ;? (set dump-trace*)
 (add-fns
@@ -1393,6 +1421,16 @@
   (prn "F - convert-names replaces field offsets with multiple mentions"))
 ;? (quit)
 
+(reset)
+(new-trace "convert-names-label")
+(if (~iso (convert-names
+            '(((1 integer) <- copy (4 literal))
+              foo))
+          '(((1 integer) <- copy (4 literal))
+            foo))
+  (prn "F - convert-names skips past labels"))
+;? (quit)
+
 ; A rudimentary memory allocator. Eventually we want to write this in mu.
 ;
 ; No deallocation yet; let's see how much code we can build in mu before we
@@ -2344,12 +2382,6 @@
   (prn "F - channels are meant to be shared between routines"))
 ;? (quit)
 
-;? (reset)
-;? (new-trace "channel-race")
-;? (add-fns
-;?   '((reader
-;?       ((
-
 ;; Separating concerns
 ;
 ; Lightweight tools can also operate on quoted lists of statements surrounded