|
|
@@ -52,7 +52,6 @@ class Parser: |
|
|
|
# Define parser functions |
|
|
|
start_symbol = start_symbol or self.start_symbol |
|
|
|
delayed_matches = defaultdict(list) |
|
|
|
match_after_ignore = set() |
|
|
|
|
|
|
|
text_line = 1 |
|
|
|
text_column = 0 |
|
|
@@ -89,8 +88,7 @@ class Parser: |
|
|
|
m = x.match(stream, i) |
|
|
|
if m: |
|
|
|
delayed_matches[m.end()] += set(to_scan) |
|
|
|
if m.end() == len(stream): |
|
|
|
match_after_ignore.update(set(column.to_reduce)) |
|
|
|
delayed_matches[m.end()] += set(column.to_reduce) |
|
|
|
|
|
|
|
# TODO add partial matches for ignore too? |
|
|
|
# s = m.group(0) |
|
|
@@ -142,10 +140,6 @@ class Parser: |
|
|
|
solutions = [n.tree for n in column.to_reduce |
|
|
|
if n.rule.origin==start_symbol and n.start is column0] |
|
|
|
|
|
|
|
if not solutions: |
|
|
|
solutions = [n.tree for n in match_after_ignore |
|
|
|
if n.rule.origin==start_symbol and n.start is column0] |
|
|
|
|
|
|
|
if not solutions: |
|
|
|
raise ParseError('Incomplete parse: Could not find a solution to input') |
|
|
|
elif len(solutions) == 1: |
|
|
|