When I try to compile the following grammar with Gazelle 0.4:
@start start;
start -> next;
next -> end;
end -> "X";
whitespace -> .whitespace=/x+/;
@allow whitespace start ... end;
why do I get this error?
gzlc: compiler/ll.lua:726: Ambiguous grammar for state starting in
rule next, paths={{"enter", "whitespace"}, {"term", "whitespace"},
{"return"}, {"return", "start"}, {"return", "eof"}, {"term", {class =
Class: "SingletonEdgeValue"}}} AND {{"return", "start"}, {"enter",
"whitespace"}, {"term", "whitespace"}, {"return"}, {"return", "eof"},
{"term", {class = Class: "SingletonEdgeValue"}}}
The above grammar is a minimal test case; I originally encountered
this error while attempting to update sketches/rtn.gzl to work with
the new @allow syntax in Gazelle 0.4. I ran into it again when
modifying other files in sketches/.
http://github.com/mbrubeck/gazelle/commit/41bdb8e64f8daf3f8c38b309aac7b4990b7de52b