summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-02-14 21:32:42 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-02-14 21:32:42 (GMT)
commit17988d2a175dbf9acade5588a36913c96b591a17 (patch)
treefcf64c2020aee72726ce0e4edc60689daae89e7a
parentb217687a6cb8f81db5040ccc6b5f1b25a6994c3a (diff)
downloadcpython-17988d2a175dbf9acade5588a36913c96b591a17.zip
cpython-17988d2a175dbf9acade5588a36913c96b591a17.tar.gz
cpython-17988d2a175dbf9acade5588a36913c96b591a17.tar.bz2
LeftShift & RightShift: fix reprs, change attr names to left and right
(so they are common with other binary ops)
-rw-r--r--Lib/compiler/ast.py20
-rw-r--r--Tools/compiler/compiler/ast.py20
2 files changed, 20 insertions, 20 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py
index 22c1b04..c70da76 100644
--- a/Lib/compiler/ast.py
+++ b/Lib/compiler/ast.py
@@ -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'
diff --git a/Tools/compiler/compiler/ast.py b/Tools/compiler/compiler/ast.py
index 22c1b04..c70da76 100644
--- a/Tools/compiler/compiler/ast.py
+++ b/Tools/compiler/compiler/ast.py
@@ -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'