Remove some code that wasn't doing anything.

This commit is contained in:
Dave Halter
2017-07-17 08:49:02 +02:00
parent 837e9ca388
commit 6ee986aa45

View File

@@ -222,15 +222,14 @@ class Parser(BaseParser):
stack[-1][2][1].append(error_leaf) stack[-1][2][1].append(error_leaf)
def _stack_removal(self, pgen_grammar, stack, arcs, start_index, value, start_pos): def _stack_removal(self, pgen_grammar, stack, arcs, start_index, value, start_pos):
failed_stack = [] failed_stack = False
found = False found = False
all_nodes = [] all_nodes = []
for dfa, state, (typ, nodes) in stack[start_index:]: for dfa, state, (type_, nodes) in stack[start_index:]:
if nodes: if nodes:
found = True found = True
if found: if found:
symbol = pgen_grammar.number2symbol[typ] failed_stack = True
failed_stack.append((symbol, nodes))
all_nodes += nodes all_nodes += nodes
if failed_stack: if failed_stack:
stack[start_index - 1][2][1].append(tree.PythonErrorNode(all_nodes)) stack[start_index - 1][2][1].append(tree.PythonErrorNode(all_nodes))