Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
17988d2a
Commit
17988d2a
authored
Feb 14, 2000
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LeftShift & RightShift: fix reprs, change attr names to left and right
(so they are common with other binary ops)
parent
b217687a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
Lib/compiler/ast.py
Lib/compiler/ast.py
+10
-10
Tools/compiler/compiler/ast.py
Tools/compiler/compiler/ast.py
+10
-10
No files found.
Lib/compiler/ast.py
View file @
17988d2a
...
...
@@ -568,24 +568,24 @@ class Bitand(Node):
class
LeftShift
(
Node
):
nodes
[
'<<'
]
=
'LeftShift'
def
__init__
(
self
,
(
expr
,
shif
t
)):
self
.
expr
=
expr
self
.
shift
=
shif
t
self
.
_children
=
(
'<<'
,
(
expr
,
shif
t
))
def
__init__
(
self
,
(
left
,
righ
t
)):
self
.
left
=
left
self
.
right
=
righ
t
self
.
_children
=
(
'<<'
,
(
left
,
righ
t
))
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
,
shif
t
)):
self
.
expr
=
expr
self
.
shift
=
shif
t
self
.
_children
=
(
'>>'
,
(
expr
,
shif
t
))
def
__init__
(
self
,
(
left
,
righ
t
)):
self
.
left
=
left
self
.
right
=
righ
t
self
.
_children
=
(
'>>'
,
(
left
,
righ
t
))
def
__repr__
(
self
):
return
"RightShift(%s
,%s
)"
%
self
.
_children
[
1
:]
return
"RightShift(%s)"
%
self
.
_children
[
1
:]
class
Add
(
Node
):
nodes
[
'+'
]
=
'Add'
...
...
Tools/compiler/compiler/ast.py
View file @
17988d2a
...
...
@@ -568,24 +568,24 @@ class Bitand(Node):
class
LeftShift
(
Node
):
nodes
[
'<<'
]
=
'LeftShift'
def
__init__
(
self
,
(
expr
,
shif
t
)):
self
.
expr
=
expr
self
.
shift
=
shif
t
self
.
_children
=
(
'<<'
,
(
expr
,
shif
t
))
def
__init__
(
self
,
(
left
,
righ
t
)):
self
.
left
=
left
self
.
right
=
righ
t
self
.
_children
=
(
'<<'
,
(
left
,
righ
t
))
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
,
shif
t
)):
self
.
expr
=
expr
self
.
shift
=
shif
t
self
.
_children
=
(
'>>'
,
(
expr
,
shif
t
))
def
__init__
(
self
,
(
left
,
righ
t
)):
self
.
left
=
left
self
.
right
=
righ
t
self
.
_children
=
(
'>>'
,
(
left
,
righ
t
))
def
__repr__
(
self
):
return
"RightShift(%s
,%s
)"
%
self
.
_children
[
1
:]
return
"RightShift(%s)"
%
self
.
_children
[
1
:]
class
Add
(
Node
):
nodes
[
'+'
]
=
'Add'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment