LeftShift & RightShift: fix reprs, change attr names to left and right

(so they are common with other binary ops)
This commit is contained in:
Jeremy Hylton 2000-02-14 21:32:42 +00:00
parent b217687a6c
commit 17988d2a17
2 changed files with 20 additions and 20 deletions

View File

@ -568,24 +568,24 @@ class Bitand(Node):
class LeftShift(Node):
nodes['<<'] = 'LeftShift'
def __init__(self, (expr, shift)):
self.expr = expr
self.shift = shift
self._children = ('<<', (expr, shift))
def __init__(self, (left, right)):
self.left = left
self.right = right
self._children = ('<<', (left, right))
def __repr__(self):
return "LeftShift(%s,%s)" % self._children[1:]
return "LeftShift(%s)" % self._children[1:]
class RightShift(Node):
nodes['>>'] = 'RightShift'
def __init__(self, (expr, shift)):
self.expr = expr
self.shift = shift
self._children = ('>>', (expr, shift))
def __init__(self, (left, right)):
self.left = left
self.right = right
self._children = ('>>', (left, right))
def __repr__(self):
return "RightShift(%s,%s)" % self._children[1:]
return "RightShift(%s)" % self._children[1:]
class Add(Node):
nodes['+'] = 'Add'

View File

@ -568,24 +568,24 @@ class Bitand(Node):
class LeftShift(Node):
nodes['<<'] = 'LeftShift'
def __init__(self, (expr, shift)):
self.expr = expr
self.shift = shift
self._children = ('<<', (expr, shift))
def __init__(self, (left, right)):
self.left = left
self.right = right
self._children = ('<<', (left, right))
def __repr__(self):
return "LeftShift(%s,%s)" % self._children[1:]
return "LeftShift(%s)" % self._children[1:]
class RightShift(Node):
nodes['>>'] = 'RightShift'
def __init__(self, (expr, shift)):
self.expr = expr
self.shift = shift
self._children = ('>>', (expr, shift))
def __init__(self, (left, right)):
self.left = left
self.right = right
self._children = ('>>', (left, right))
def __repr__(self):
return "RightShift(%s,%s)" % self._children[1:]
return "RightShift(%s)" % self._children[1:]
class Add(Node):
nodes['+'] = 'Add'