mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Whitespace normalization.
This commit is contained in:
parent
2ee8099bd8
commit
0e9980f75a
7 changed files with 26 additions and 26 deletions
|
@ -553,7 +553,7 @@ class Function(Node):
|
|||
self.varargs = 1
|
||||
if flags & CO_VARKEYWORDS:
|
||||
self.kwargs = 1
|
||||
|
||||
|
||||
|
||||
|
||||
def getChildren(self):
|
||||
|
@ -584,7 +584,7 @@ class GenExpr(Node):
|
|||
self.lineno = lineno
|
||||
self.argnames = ['[outmost-iterable]']
|
||||
self.varargs = self.kwargs = None
|
||||
|
||||
|
||||
|
||||
|
||||
def getChildren(self):
|
||||
|
@ -763,7 +763,7 @@ class Lambda(Node):
|
|||
self.varargs = 1
|
||||
if flags & CO_VARKEYWORDS:
|
||||
self.kwargs = 1
|
||||
|
||||
|
||||
|
||||
|
||||
def getChildren(self):
|
||||
|
@ -1313,4 +1313,4 @@ class Yield(Node):
|
|||
|
||||
for name, obj in globals().items():
|
||||
if isinstance(obj, type) and issubclass(obj, Node):
|
||||
nodes[name.lower()] = obj
|
||||
nodes[name.lower()] = obj
|
||||
|
|
|
@ -79,7 +79,7 @@ def extractLineNo(ast):
|
|||
lineno = extractLineNo(child)
|
||||
if lineno is not None:
|
||||
return lineno
|
||||
|
||||
|
||||
def Node(*args):
|
||||
kind = args[0]
|
||||
if nodes.has_key(kind):
|
||||
|
@ -127,7 +127,7 @@ class Transformer:
|
|||
def parsesuite(self, text):
|
||||
"""Return a modified parse tree for the given suite text."""
|
||||
return self.transform(parser.suite(text))
|
||||
|
||||
|
||||
def parseexpr(self, text):
|
||||
"""Return a modified parse tree for the given expression text."""
|
||||
return self.transform(parser.expr(text))
|
||||
|
@ -426,7 +426,7 @@ class Transformer:
|
|||
|
||||
def import_name(self, nodelist):
|
||||
# import_name: 'import' dotted_as_names
|
||||
return Import(self.com_dotted_as_names(nodelist[1]),
|
||||
return Import(self.com_dotted_as_names(nodelist[1]),
|
||||
lineno=nodelist[0][2])
|
||||
|
||||
def import_from(self, nodelist):
|
||||
|
@ -514,7 +514,7 @@ class Transformer:
|
|||
else:
|
||||
elseNode = None
|
||||
|
||||
return For(assignNode, listNode, bodyNode, elseNode,
|
||||
return For(assignNode, listNode, bodyNode, elseNode,
|
||||
lineno=nodelist[0][2])
|
||||
|
||||
def try_stmt(self, nodelist):
|
||||
|
@ -887,7 +887,7 @@ class Transformer:
|
|||
def com_try_finally(self, nodelist):
|
||||
# try_fin_stmt: "try" ":" suite "finally" ":" suite
|
||||
return TryFinally(self.com_node(nodelist[2]),
|
||||
self.com_node(nodelist[5]),
|
||||
self.com_node(nodelist[5]),
|
||||
lineno=nodelist[0][2])
|
||||
|
||||
def com_try_except(self, nodelist):
|
||||
|
@ -1226,7 +1226,7 @@ class Transformer:
|
|||
subscripts = []
|
||||
for i in range(1, len(nodelist), 2):
|
||||
subscripts.append(self.com_subscript(nodelist[i]))
|
||||
return Subscript(primary, assigning, subscripts,
|
||||
return Subscript(primary, assigning, subscripts,
|
||||
lineno=extractLineNo(nodelist))
|
||||
|
||||
def com_subscript(self, node):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue