idl = [a-d]
}
-testcase "a+b*c" {
+testcase "priority" {
input "a+b*c";
output "plus:{stringify:{a} times:{stringify:{b} stringify:{c}}}";
w = " "
idl = [a-d]
}
+testcase "associativity" {
+ input "a*b*c";
+ output "times:{stringify:{a} times:{stringify:{b} stringify:{c}}}";
+ w = " "
+ l = id
+ s = assign:: l "=" r
+ | r
+ r = l
+ | assign:: l "=" r
+ | plus:: r "+" r
+ | times:: r "*" (r)
+ | "(" r ")"
+ | times:: r r
+ id = stringify:: idl++
+ idl = [a-d]
+}
+
testcase "unnamed" {
input "aa bb";
output "{q:{a a} q:{b b}}";
B:: = ~~(... "bbb" ...)
C:: = [ab]*
}
+
+testcase "lifts" {
+ input "a+(b*c)";
+ output "+:{a *:{id:{b} c}}";
+
+ s = r
+ r = id
+ | r ^"*" `r
+ | `r ^"+" r
+ | "(" r ")"
+ id:: = [a-z]++
+}
+
+testcase "epsilon as a positive conjunct" {
+ input "abababab";
+ s:: = X*
+ X:: = "a" ("b"+ & ())
+}
+
+testcase "ensure sharing of so-called reduction nodes" {
+ input "a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ";
+ ignore output;
+ s:: = (S!)+
+ S:: = A:: "a "
+ | B:: "a "
+}
+
+testcase "epsilon as a negative conjunct" {
+ input "aaaaa";
+ s:: = X*
+ X:: = "a" ("b"* &~ ())
+}
+