+call = expr "()" /ws
+
+num = "":: [0-9]++
+
+ident = "":: [a-z]++ &~ keyword
+keyword = "if" | "then" | "else" | "while"
+
+
+
+}
+
+
+testcase "unnamed" {
+ input "abc ";
+
+ s = s2:: q " "*
+ q = a3:: [a-z] [a-z] [a-z]
+ &~ ("":: ~[])! "b" ("":: ~[]*)!
+}
+
+testcase "unnamed" {
+ input "abc ";
+ output "s:{a b c}";
+
+ s = s:: [a-z] [a-z] [a-z] " "*
+}
+
+testcase "a+2" {
+
+ input "a+2";
+ output "Plus:{left:{Foo} right:{{2}}}";
+
+ s = Expr
+ Expr = "":: [0-9]++
+ | Plus:: (left::Expra) "+" (right::Expr)
+ Expra = Foo:: ("a" | "b")
+
+}
+
+testcase "unnamed" {
+ input "aaaaa";
+ output "top:{a q:{a a a} a}";
+
+ s = top:: z (q::"a"*) z
+ z = a:: "a"
+}
+
+testcase "dangling else" {
+ input "if (x) if (y) z else q";
+ output "if:{ident:{x} else:{if:{ident:{y} then:{ident:{z}}} ident:{q}}}";
+
+ s = Expr
+ Expr = if:: "if" "(" Expr ")" IfBody /ws
+ | ident:: [a-z]++
+ IfBody = else:: Expr "else" Expr /ws
+ | then:: Expr &~ (("":: (~[])*) "else" Expr! /ws)
+ ws = "":: [ ]**
+}
+