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
126960b7
Commit
126960b7
authored
Feb 14, 2000
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
looks like everything is working except for try/except (pystone
compiles correctly)
parent
17988d2a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
Lib/compiler/pycodegen.py
Lib/compiler/pycodegen.py
+14
-6
Tools/compiler/compiler/pycodegen.py
Tools/compiler/compiler/pycodegen.py
+14
-6
No files found.
Lib/compiler/pycodegen.py
View file @
126960b7
...
...
@@ -153,11 +153,6 @@ class CodeGenerator:
"""TODO
EmptyNode
Exec
Invert
LeftShift
Power
RightShift
Sliceobj
Tryexcept
Tryfinally
...
...
@@ -276,6 +271,8 @@ class CodeGenerator:
self
.
emit
(
'SET_LINENO'
,
node
.
lineno
)
self
.
emit
(
'IMPORT_NAME'
,
node
.
modname
)
for
name
in
node
.
names
:
if
name
==
'*'
:
self
.
namespace
=
0
self
.
emit
(
'IMPORT_FROM'
,
name
)
self
.
emit
(
'POP_TOP'
)
...
...
@@ -524,7 +521,6 @@ class CodeGenerator:
return
1
def
visitAssign
(
self
,
node
):
print
"ASSIGN"
,
node
.
expr
self
.
emit
(
'SET_LINENO'
,
node
.
lineno
)
self
.
visit
(
node
.
expr
)
dups
=
len
(
node
.
nodes
)
-
1
...
...
@@ -583,6 +579,18 @@ class CodeGenerator:
def
visitMod
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_MODULO'
)
def
visitPower
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_POWER'
)
def
visitLeftShift
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_LSHIFT'
)
def
visitRightShift
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_RSHIFT'
)
def
visitInvert
(
self
,
node
):
return
self
.
unaryOp
(
node
,
'UNARY_INVERT'
)
def
visitUnarySub
(
self
,
node
):
return
self
.
unaryOp
(
node
,
'UNARY_NEGATIVE'
)
...
...
Tools/compiler/compiler/pycodegen.py
View file @
126960b7
...
...
@@ -153,11 +153,6 @@ class CodeGenerator:
"""TODO
EmptyNode
Exec
Invert
LeftShift
Power
RightShift
Sliceobj
Tryexcept
Tryfinally
...
...
@@ -276,6 +271,8 @@ class CodeGenerator:
self
.
emit
(
'SET_LINENO'
,
node
.
lineno
)
self
.
emit
(
'IMPORT_NAME'
,
node
.
modname
)
for
name
in
node
.
names
:
if
name
==
'*'
:
self
.
namespace
=
0
self
.
emit
(
'IMPORT_FROM'
,
name
)
self
.
emit
(
'POP_TOP'
)
...
...
@@ -524,7 +521,6 @@ class CodeGenerator:
return
1
def
visitAssign
(
self
,
node
):
print
"ASSIGN"
,
node
.
expr
self
.
emit
(
'SET_LINENO'
,
node
.
lineno
)
self
.
visit
(
node
.
expr
)
dups
=
len
(
node
.
nodes
)
-
1
...
...
@@ -583,6 +579,18 @@ class CodeGenerator:
def
visitMod
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_MODULO'
)
def
visitPower
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_POWER'
)
def
visitLeftShift
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_LSHIFT'
)
def
visitRightShift
(
self
,
node
):
return
self
.
binaryOp
(
node
,
'BINARY_RSHIFT'
)
def
visitInvert
(
self
,
node
):
return
self
.
unaryOp
(
node
,
'UNARY_INVERT'
)
def
visitUnarySub
(
self
,
node
):
return
self
.
unaryOp
(
node
,
'UNARY_NEGATIVE'
)
...
...
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