Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
84ec1f91
Kaydet (Commit)
84ec1f91
authored
Nis 11, 2001
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
typo
üst
01d12937
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
pycodegen.py
Lib/compiler/pycodegen.py
+8
-4
pycodegen.py
Tools/compiler/compiler/pycodegen.py
+8
-4
No files found.
Lib/compiler/pycodegen.py
Dosyayı görüntüle @
84ec1f91
...
...
@@ -45,7 +45,10 @@ class Module:
def
compile
(
self
,
display
=
0
):
tree
=
parse
(
self
.
source
)
root
,
filename
=
os
.
path
.
split
(
self
.
filename
)
gen
=
ModuleCodeGenerator
(
filename
)
if
"nested_scopes"
in
future
.
find_futures
(
tree
):
gen
=
NestedScopeCodeGenerator
(
filename
)
else
:
gen
=
ModuleCodeGenerator
(
filename
)
walk
(
tree
,
gen
,
1
)
if
display
:
import
pprint
...
...
@@ -646,7 +649,7 @@ class CodeGenerator:
def
visitAugSlice
(
self
,
node
,
mode
):
if
mode
==
"load"
:
self
.
visit
lS
ice
(
node
,
1
)
self
.
visit
Sl
ice
(
node
,
1
)
elif
mode
==
"store"
:
slice
=
0
if
node
.
lower
:
...
...
@@ -889,10 +892,8 @@ class ModuleCodeGenerator(CodeGenerator):
self
.
graph
=
pyassem
.
PyFlowGraph
(
"<module>"
,
filename
)
self
.
__super_init
(
filename
)
self
.
symbols
=
None
self
.
future
=
None
def
visitModule
(
self
,
node
):
self
.
future
=
future
.
find_futures
(
node
)
self
.
symbols
=
self
.
parseSymbols
(
node
)
self
.
__super_visitModule
(
node
)
...
...
@@ -900,6 +901,9 @@ class ModuleCodeGenerator(CodeGenerator):
# XXX not implemented
return
None
class
NestedScopeCodeGenerator
(
ModuleCodeGenerator
):
pass
class
FunctionCodeGenerator
(
CodeGenerator
):
super_init
=
CodeGenerator
.
__init__
...
...
Tools/compiler/compiler/pycodegen.py
Dosyayı görüntüle @
84ec1f91
...
...
@@ -45,7 +45,10 @@ class Module:
def
compile
(
self
,
display
=
0
):
tree
=
parse
(
self
.
source
)
root
,
filename
=
os
.
path
.
split
(
self
.
filename
)
gen
=
ModuleCodeGenerator
(
filename
)
if
"nested_scopes"
in
future
.
find_futures
(
tree
):
gen
=
NestedScopeCodeGenerator
(
filename
)
else
:
gen
=
ModuleCodeGenerator
(
filename
)
walk
(
tree
,
gen
,
1
)
if
display
:
import
pprint
...
...
@@ -646,7 +649,7 @@ class CodeGenerator:
def
visitAugSlice
(
self
,
node
,
mode
):
if
mode
==
"load"
:
self
.
visit
lS
ice
(
node
,
1
)
self
.
visit
Sl
ice
(
node
,
1
)
elif
mode
==
"store"
:
slice
=
0
if
node
.
lower
:
...
...
@@ -889,10 +892,8 @@ class ModuleCodeGenerator(CodeGenerator):
self
.
graph
=
pyassem
.
PyFlowGraph
(
"<module>"
,
filename
)
self
.
__super_init
(
filename
)
self
.
symbols
=
None
self
.
future
=
None
def
visitModule
(
self
,
node
):
self
.
future
=
future
.
find_futures
(
node
)
self
.
symbols
=
self
.
parseSymbols
(
node
)
self
.
__super_visitModule
(
node
)
...
...
@@ -900,6 +901,9 @@ class ModuleCodeGenerator(CodeGenerator):
# XXX not implemented
return
None
class
NestedScopeCodeGenerator
(
ModuleCodeGenerator
):
pass
class
FunctionCodeGenerator
(
CodeGenerator
):
super_init
=
CodeGenerator
.
__init__
...
...
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