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
5d1e34aa
Kaydet (Commit)
5d1e34aa
authored
Eyl 17, 2001
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Track changes to compiler API
üst
9dca3643
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
compile.py
Tools/compiler/compile.py
+6
-4
regrtest.py
Tools/compiler/regrtest.py
+9
-5
No files found.
Tools/compiler/compile.py
Dosyayı görüntüle @
5d1e34aa
import
sys
import
getopt
from
compiler
import
compile
,
visitor
from
compiler
import
compile
File
,
visitor
import
profile
...
...
@@ -35,14 +35,16 @@ def main():
print
filename
try
:
if
PROFILE
:
profile
.
run
(
'compile(
%
s,
%
s)'
%
(
`filename`
,
`DISPLAY`
),
profile
.
run
(
'compileFile(
%
s,
%
s)'
%
(
`filename`
,
`DISPLAY`
),
filename
+
".prof"
)
else
:
compile
(
filename
,
DISPLAY
)
compile
File
(
filename
,
DISPLAY
)
except
SyntaxError
,
err
:
print
err
print
err
.
lineno
if
err
.
lineno
is
not
None
:
print
err
.
lineno
if
not
CONTINUE
:
sys
.
exit
(
-
1
)
...
...
Tools/compiler/regrtest.py
Dosyayı görüntüle @
5d1e34aa
...
...
@@ -7,7 +7,7 @@ The regression test is run with the interpreter in verbose mode so
that import problems can be observed easily.
"""
from
compiler
import
compile
from
compiler
import
compile
File
import
os
import
sys
...
...
@@ -25,12 +25,13 @@ def copy_library():
dest
=
tempfile
.
mktemp
()
os
.
mkdir
(
dest
)
libdir
=
os
.
path
.
split
(
test
.
__path__
[
0
])[
0
]
os
.
system
(
"cp -r
%
s/*
%
s"
%
(
libdir
,
dest
))
print
"Found standard library in"
,
libdir
print
"Creating copy of standard library in"
,
dest
os
.
system
(
"cp -r
%
s/*
%
s"
%
(
libdir
,
dest
))
return
dest
def
compile_files
(
dir
):
print
"Compiling"
,
dir
print
"Compiling"
,
dir
,
"
\n\t
"
,
line_len
=
10
for
file
in
os
.
listdir
(
dir
):
base
,
ext
=
os
.
path
.
splitext
(
file
)
...
...
@@ -42,7 +43,7 @@ def compile_files(dir):
line_len
=
len
(
source
)
+
9
print
file
,
try
:
compile
(
source
)
compile
File
(
source
)
except
SyntaxError
,
err
:
print
err
continue
...
...
@@ -51,14 +52,17 @@ def compile_files(dir):
else
:
path
=
os
.
path
.
join
(
dir
,
file
)
if
os
.
path
.
isdir
(
path
):
print
print
compile_files
(
path
)
print
"
\t
"
,
line_len
=
10
print
def
run_regrtest
(
lib_dir
):
test_dir
=
os
.
path
.
join
(
lib_dir
,
"test"
)
os
.
chdir
(
test_dir
)
os
.
system
(
"PYTHONPATH=
%
s
%
s -v regrtest.py
-r
"
%
(
lib_dir
,
sys
.
executable
))
os
.
system
(
"PYTHONPATH=
%
s
%
s -v regrtest.py"
%
(
lib_dir
,
sys
.
executable
))
def
cleanup
(
dir
):
os
.
system
(
"rm -rf
%
s"
%
dir
)
...
...
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