more improvements to TibDoc
[sbp.git] / tests / regression.tc
index 78d35e3..cbb50ce 100644 (file)
@@ -357,4 +357,17 @@ testcase {
     input "aaaaa";
     s = top:: z (q::"a"*) z
     z = a:: "a"
-}
\ No newline at end of file
+}
+
+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     = [ ]**
+}
+