s = Expr
Expr = [0-9]++
- | Plus:: left:Expra "+" right:Expr
+ | Plus:: (left::Expra) "+" (right::Expr)
Expra = Foo:: ("a" | "b")
}
+
+testcase {
+ input "aaaaa";
+ s = top:: z (q::"a"*) z
+ 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 = [ ]**
+}
+