Fix an ambiguity issue

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

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)