unrolling forests without recursion
[sbp.git] / tests / loop.tc
index c7b6590..d29cb2f 100644 (file)
@@ -1,23 +1,20 @@
 testcase {
-    input "if (bar!) baz!;";
-    output "IfThen:{id:{x:{b x:{a r}}} id:{x:{b x:{a z}}}}";
+    input "if (bar) if (bop) baz";
+    output "";
 
-    s             = Expr ";"
+    s             = Expr
     Expr          = IfThen
                   | IfThenElse
-                  | id:: id "!"
-    id = [a-z] | x:: [a-z] id
+                  | id:: [a-z]++
     IfThen        = IfThen::
                        "if" "(" Expr ")"
                        Expr
                            /ws
     IfThenElse    = IfThenElse::
                        "if" "(" Expr ")"
-                       NotIfThenExpr
-                       "else"
-                       Expr
+                       ((thenelse:: Expr
+                        "else"
+                        Expr /ws)) /ws
                            /ws
-    NotIfThenExpr = (Expr & [a-z]+)
-    SpaceIfThen   = (~[])*// !IfThen
     ws            = [\n ]**
 }
\ No newline at end of file