Small fix with big impact for the previously done simple_stmt error recovery. Now it actually works.

This commit is contained in:
Dave Halter
2014-12-07 19:45:19 +01:00
parent 2b7434342e
commit bb747a83e8
+1 -1
View File
@@ -230,7 +230,7 @@ class Parser(object):
index, symbol, nodes = current_suite(stack) index, symbol, nodes = current_suite(stack)
if symbol == 'simple_stmt': if symbol == 'simple_stmt':
index -= 1 index -= 2
(_, _, (typ, suite_nodes)) = stack[index] (_, _, (typ, suite_nodes)) = stack[index]
symbol = grammar.number2symbol[typ] symbol = grammar.number2symbol[typ]
suite_nodes.append(pt.Node(symbol, list(nodes))) suite_nodes.append(pt.Node(symbol, list(nodes)))