tentative checkpoint
[sbp.git] / tests / ifthen.tc
diff --git a/tests/ifthen.tc b/tests/ifthen.tc
new file mode 100644 (file)
index 0000000..dbb613d
--- /dev/null
@@ -0,0 +1,14 @@
+testcase {
+  input "if (foo) if (bar) baz else bop";
+  output "IfThen:{Identifier:{{f o o}} IfThenElse:{IfThen:{Identifier:{{b a r}} Identifier:{{b a z}}} Identifier:{{b o p}}}}";
+
+  s             = Expr
+
+  Expr          =              IfThen
+                | IfThenElse:: IfThen "else" Expr /ws &~ IfThen
+                | Identifier:: [a-z]++ 
+  IfThen        = IfThen:: "if" "(" Expr ")" Expr             /ws
+
+  ws            = [\n ]**
+
+}