Fix an ambiguity issue

Unfortunately had to refactor most of the transition generation
This commit is contained in:
Dave Halter committed 2018-06-26 00:58:19 +02:00
1 parent da5aa8a2ab
commit a46ecbb499
3 files changed
+80 -66

No files matched your search

+3
View File
@@ -282,3 +282,6 @@ def test_left_recursion():
def test_ambiguities():
with pytest.raises(ValueError, match='ambiguous'):
generate_grammar('foo: bar | baz\nbar: NAME\nbaz: NAME\n', tokenize.PythonTokenTypes)
with pytest.raises(ValueError, match='ambiguous'):
generate_grammar('''foo: bar | baz\nbar: 'x'\nbaz: "x"\n''', tokenize.PythonTokenTypes)