added if-then-else dangling testcase
authoradam <adam@megacz.com>
Sun, 5 Mar 2006 07:00:39 +0000 (02:00 -0500)
committeradam <adam@megacz.com>
Sun, 5 Mar 2006 07:00:39 +0000 (02:00 -0500)
darcs-hash:20060305070039-5007d-78d48ed02bc5088d6978ae9fb2f685fb775a5fd3.gz

tests/regression.tc

index af600f3..cbb50ce 100644 (file)
@@ -359,3 +359,15 @@ testcase {
     z = a:: "a"
 }
 
+testcase {
+    input  "if (x) if (y) z else q";
+    output "if:{ident:{{x}} else:{if:{ident:{{y}} then:{ident:{{z}}}} ident:{{q}}}}";
+
+    s      = e
+    Expr   = if::     "if" "(" Expr ")" IfBody     /ws
+           | ident::  [a-z]++
+    IfBody = else::   Expr             "else" Expr /ws
+           | then::   Expr &~     ~[]* "else" Expr /ws
+    ws     = [ ]**
+}
+