-//testcase {
-// input "x";
-// output "a:{x}";
-//
-// s = a1:: a
-// a = s1:: s
-// a = ^"x"
-//}
-//
-//testcase {
-// input "x";
-// output "x";
-// output "s2:{s2:{s0 s0} x}";
-// output "s2:{s0 x}";
-//
-//
-// s = s2:: s s
-// s = ^"x"
-// s = s0:: ()
-//}
-
testcase {
input "aaaaa";
s = A
| "a" A &~ "a" s
}
-//testcase {
-// input "a";
-// output "yes:{}";
-// s = A
-// A = "a" s &~ "a" A
-// | "a" A &~ "a" s
-// | ()
-//}
-
testcase {
input "ab c";
output "1:{{a b} {c}}";
x = ~[]
s = xbx:: x* b x*
b = abab:: [ab][ab]
- &~ ( "aa" | "bb" )
+ &~ ("aa"|"bb")
}
testcase {
idl = [a-d]
}
-//testcase {
-// input "a*b*c";
-// output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
-// w = " "
-// l = id
-// s = l "=" r => "assign"
-// | r
-// r = l
-// | l "=" r => "assign"
-// | r "+" r => "plus"
-// | (r) "*" r => "times"
-// | "(" r ")"
-// | r r => "times"
-// id = idl++ => "stringify"
-// idl = [a-d]
-//}
-
testcase {
input "a+b*c";
output "plus:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
}
-
-
testcase {
input "abc ";
x = [123]
}
-
-//testcase {
-// input "ab";
-//
-// s = a:"a" b:"b"
-//}
-
-
-testcase {
- input "a c";
- s = first:: A WSA B? WSB C
- A = "a"
- B = "b"
- C = "c"
- WSA = WSA:: " "**
- WSB = () -> ~" "
- | WSB:: " "++
-}
-
-//testcase {
-// input "aaaaaXaaaa";
-// output "";
-// s = ManyA &~ EndsWithZ
-// EndsWithZ = Anything "Z"
-// ManyA = () | "a" ManyA
-// Anything = () | ("a" | "X" | "Z") Anything
-//}
-
-testcase {
- input "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
- output "";
- s = ManyA
- ManyA = ()
- | A ManyA! & ManyAB
- A = "a"
- ManyAB = ()
- | "a" ManyAB
- | "b" ManyAB
-}
-
testcase {
input "aaaaaaaa";
output "";
AAs = () | AAs "aa"
}
+// make sure follow restrictions are honored
+// when a string matches the empty string
+testcase {
+ input "xxx";
+ s = x:: "x" A "x" C "x"
+ A = B
+ B = "y"
+ | () -> ~"x"
+ C = D -> ~"x"
+ D = ()
+}
+testcase {
+ input "axxxxxc";
+ output "q:{a {x x x x x} c}";
+ s = q:: A ws B? ws C
+ ws = [x]**
+ A = a:: "a"
+ B = b:: "b"
+ C = c:: "c"
+}