Commit 9360398a authored by Igor Dejanovic's avatar Igor Dejanovic

Fix in sequence backtracking

parent 49025b9e
...@@ -269,12 +269,14 @@ class Sequence(ParsingExpression): ...@@ -269,12 +269,14 @@ class Sequence(ParsingExpression):
""" """
def _parse(self, parser): def _parse(self, parser):
results = [] results = []
c_pos = parser.position
try: try:
for e in self.nodes: for e in self.nodes:
result = e.parse(parser) result = e.parse(parser)
if result: if result:
results.append(result) results.append(result)
except NoMatch as m: except NoMatch as m:
parser.position = c_pos # Backtracking
self._nm_change_rule(m, parser) self._nm_change_rule(m, parser)
raise raise
......
Markdown is supported
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