mirror of
https://github.com/python/cpython.git
synced 2024-11-30 05:15:14 +08:00
make all unary operators have a single child node called expr
This commit is contained in:
parent
1851901a05
commit
156a975476
@ -414,7 +414,7 @@ class Backquote(Node):
|
||||
nodes['backquote'] = 'Backquote'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('backquote', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -657,7 +657,7 @@ class UnaryAdd(Node):
|
||||
nodes['unary+'] = 'UnaryAdd'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('unary+', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -667,7 +667,7 @@ class UnarySub(Node):
|
||||
nodes['unary-'] = 'UnarySub'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('unary-', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -677,7 +677,7 @@ class Invert(Node):
|
||||
nodes['invert'] = 'Invert'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('invert', node)
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -414,7 +414,7 @@ class Backquote(Node):
|
||||
nodes['backquote'] = 'Backquote'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('backquote', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -657,7 +657,7 @@ class UnaryAdd(Node):
|
||||
nodes['unary+'] = 'UnaryAdd'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('unary+', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -667,7 +667,7 @@ class UnarySub(Node):
|
||||
nodes['unary-'] = 'UnarySub'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('unary-', node)
|
||||
|
||||
def __repr__(self):
|
||||
@ -677,7 +677,7 @@ class Invert(Node):
|
||||
nodes['invert'] = 'Invert'
|
||||
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
self.expr = node
|
||||
self._children = ('invert', node)
|
||||
|
||||
def __repr__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user