Fix a lot of the old error recovery

This commit is contained in:
Dave Halter committed 2018-06-22 09:56:58 +02:00
1 parent 68eab72229
commit 9e8066c6fd
2 files changed
+17 -26

No files matched your search

-3
View File
@@ -192,10 +192,8 @@ class PgenParser(object):
stack[-1].dfa = plan.next_dfa
for push in plan.dfa_pushes:
print('insert', push.from_rule)
stack.append(StackNode(push))
print('set next', plan.next_dfa.from_rule)
leaf = self.convert_leaf(grammar, type_, value, prefix, start_pos)
stack[-1].nodes.append(leaf)
@@ -289,7 +287,6 @@ class PgenParser(object):
def _pop(self):
tos = self.stack.pop()
print('pop', tos.nonterminal, tos.nodes)
# If there's exactly one child, return that child instead of
# creating a new node. We still create expr_stmt and
# file_input though, because a lot of Jedi depends on its