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
bf80a033
Kaydet (Commit)
bf80a033
authored
Eyl 17, 2001
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add -p option to invoke Python profiler
üst
ce0c19c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
compile.py
Tools/compiler/compile.py
+11
-5
No files found.
Tools/compiler/compile.py
Dosyayı görüntüle @
bf80a033
...
@@ -3,13 +3,14 @@ import getopt
...
@@ -3,13 +3,14 @@ import getopt
from
compiler
import
compile
,
visitor
from
compiler
import
compile
,
visitor
##
import profile
import
profile
def
main
():
def
main
():
VERBOSE
=
0
VERBOSE
=
0
DISPLAY
=
0
DISPLAY
=
0
PROFILE
=
0
CONTINUE
=
0
CONTINUE
=
0
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'vqdc'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'vqdc
p
'
)
for
k
,
v
in
opts
:
for
k
,
v
in
opts
:
if
k
==
'-v'
:
if
k
==
'-v'
:
VERBOSE
=
1
VERBOSE
=
1
...
@@ -24,6 +25,8 @@ def main():
...
@@ -24,6 +25,8 @@ def main():
DISPLAY
=
1
DISPLAY
=
1
if
k
==
'-c'
:
if
k
==
'-c'
:
CONTINUE
=
1
CONTINUE
=
1
if
k
==
'-p'
:
PROFILE
=
1
if
not
args
:
if
not
args
:
print
"no files to compile"
print
"no files to compile"
else
:
else
:
...
@@ -31,9 +34,12 @@ def main():
...
@@ -31,9 +34,12 @@ def main():
if
VERBOSE
:
if
VERBOSE
:
print
filename
print
filename
try
:
try
:
compile
(
filename
,
DISPLAY
)
if
PROFILE
:
## profile.run('compile(%s, %s)' % (`filename`, `DISPLAY`),
profile
.
run
(
'compile(
%
s,
%
s)'
%
(
`filename`
,
`DISPLAY`
),
## filename + ".prof")
filename
+
".prof"
)
else
:
compile
(
filename
,
DISPLAY
)
except
SyntaxError
,
err
:
except
SyntaxError
,
err
:
print
err
print
err
print
err
.
lineno
print
err
.
lineno
...
...
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