1
0
forked from VimPlug/jedi

Moved the convert function away from pytree

This commit is contained in:
Dave Halter
2014-11-04 19:09:58 +01:00
parent f3e4bf9ed1
commit 3518123afa
3 changed files with 48 additions and 63 deletions
+3
View File
@@ -179,6 +179,9 @@ class Parser(object):
"""Pop a nonterminal. (Internal)"""
popdfa, popstate, popnode = self.stack.pop()
children = popnode[3]
# 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 logic.
if len(children) != 1 or popnode[0] in (self.grammar.symbol2number['expr_stmt'],
self.grammar.symbol2number['file_input']):
newnode = self.convert_node(self.grammar, popnode)