tentative checkpoint ROLL THIS BACK BUT INCLUDES CRUCIAL FIX
[sbp.git] / tests / regression.tc
index 73fe509..1c47dc4 100644 (file)
@@ -389,3 +389,27 @@ testcase {
     c   = ("c":: x "2" x "1")*
     x   = [123]
 }
+
+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