- input "if (bar!) baz!;";
- output "IfThen:{id:{x:{b x:{a r}}} id:{x:{b x:{a z}}}}";
-
- s = Expr ";"
- Expr = IfThen
- | IfThenElse
- | id:: id "!"
- id = [a-z] | x:: [a-z] id
- IfThen = IfThen::
- "if" "(" Expr ")"
- Expr
- /ws
- IfThenElse = IfThenElse::
- "if" "(" Expr ")"
- NotIfThenExpr
- "else"
- Expr
- /ws
- NotIfThenExpr = (Expr & [a-z]+)
- SpaceIfThen = (~[])*// !IfThen
- ws = [\n ]**
-}
\ No newline at end of file
+ input "aaaaaaaa";
+ output "";
+ s = As & AAs
+ As = () | As "a"
+ 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"
+}