1
0
forked from VimPlug/jedi

Using expr_stmt now instead of simple_stmt as ExprStmt, because that resembles the official grammar better.

This commit is contained in:
Dave Halter
2014-10-17 12:03:41 +02:00
parent 19acdd32b7
commit d7face17f6
2 changed files with 11 additions and 5 deletions

View File

@@ -25,7 +25,6 @@ _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "grammar3.4.txt")
class Symbols(object):
def __init__(self, grammar):
"""Initializer.
@@ -95,7 +94,9 @@ def convert(grammar, raw_node):
if type in grammar.number2symbol:
# If there's exactly one child, return that child instead of
# creating a new node.
if len(children) == 1 and type != 'expr_stmt':
# We still create expr_stmt though, because a lot of Jedi depends on
# its logic.
if len(children) == 1 and type != python_symbols.expr_stmt:
return children[0]
print(raw_node, type_repr(type))
#import pdb; pdb.set_trace()