tentative checkpoint ROLL THIS BACK BUT INCLUDES CRUCIAL FIX
[sbp.git] / tests / loop.tc
diff --git a/tests/loop.tc b/tests/loop.tc
new file mode 100644 (file)
index 0000000..c7b6590
--- /dev/null
@@ -0,0 +1,23 @@
+testcase {
+    input "if (bar!) baz!;";
+    output "IfThen:{id:{x:{b x:{a r}}} id:{x:{b x:{a z}}}}";
+
+    s             = Expr ";"
+    Expr          = IfThen
+                  | IfThenElse
+                  | id:: id "!"
+    id = [a-z] | x:: [a-z] id
+    IfThen        = IfThen::
+                       "if" "(" Expr ")"
+                       Expr
+                           /ws
+    IfThenElse    = IfThenElse::
+                       "if" "(" Expr ")"
+                       NotIfThenExpr
+                       "else"
+                       Expr
+                           /ws
+    NotIfThenExpr = (Expr & [a-z]+)
+    SpaceIfThen   = (~[])*// !IfThen
+    ws            = [\n ]**
+}
\ No newline at end of file