Commit ba7079c2 authored by di68kap's avatar di68kap
Browse files

test/test_ebnf.py: tests for character-ranges added

parent 7cd2ece0
......@@ -2526,6 +2526,9 @@ class Alternative(NaryParser):
+ 'Parser "%s" at position %i out of %i is optional'
%(p.tag_name, i + 1, len(self.parsers)),
BAD_ORDER_OF_ALTERNATIVES))
# check for errors like "A" | "AB" where "AB" would never be reached,
# because a substring at the beginning is already caught by an earlier
# alternative
for i in range(2, len(self.parsers)):
fixed_start = starting_string(self.parsers[i])
if fixed_start:
......
......@@ -247,6 +247,12 @@ class TestInfiLoopsAndRecursion:
# set_config_value('static_analysis', save)
# class TestStaticAnalysis:
# def test_alternative(self):
# lang = 'doc = "A" | "AB"'
# parser = create_parser(lang)
class TestFlowControl:
t1 = """
All work and no play
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment