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

Fix in sequence backtracking

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