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
ec5d6b90
Kaydet (Commit)
ec5d6b90
authored
Haz 09, 2002
tarafından
Just van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
escape 8-bit chars when generating .py files. fixes bug #566302
üst
47df99d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
scantools.py
Tools/bgen/bgen/scantools.py
+16
-1
No files found.
Tools/bgen/bgen/scantools.py
Dosyayı görüntüle @
ec5d6b90
...
@@ -433,6 +433,7 @@ if missing: raise "Missing Types"
...
@@ -433,6 +433,7 @@ if missing: raise "Missing Types"
def
dosymdef
(
self
,
match
):
def
dosymdef
(
self
,
match
):
name
,
defn
=
match
.
group
(
'name'
,
'defn'
)
name
,
defn
=
match
.
group
(
'name'
,
'defn'
)
defn
=
escape8bit
(
defn
)
if
self
.
debug
:
if
self
.
debug
:
self
.
report
(
"
\t
sym: name=
%
s, defn=
%
s"
%
(
`name`
,
`defn`
))
self
.
report
(
"
\t
sym: name=
%
s, defn=
%
s"
%
(
`name`
,
`defn`
))
if
not
name
in
self
.
blacklistnames
:
if
not
name
in
self
.
blacklistnames
:
...
@@ -638,7 +639,21 @@ class Scanner_OSX(Scanner):
...
@@ -638,7 +639,21 @@ class Scanner_OSX(Scanner):
self
.
whole_pat
=
self
.
type_pat
+
self
.
name_pat
+
self
.
args_pat
self
.
whole_pat
=
self
.
type_pat
+
self
.
name_pat
+
self
.
args_pat
self
.
sym_pat
=
"^[
\t
]*(?P<name>[a-zA-Z0-9_]+)[
\t
]*="
+
\
self
.
sym_pat
=
"^[
\t
]*(?P<name>[a-zA-Z0-9_]+)[
\t
]*="
+
\
"[
\t
]*(?P<defn>[-0-9_a-zA-Z'
\"
\
(][^
\t\n
,;}]*),?"
"[
\t
]*(?P<defn>[-0-9_a-zA-Z'
\"
\
(][^
\t\n
,;}]*),?"
_8bit
=
re
.
compile
(
r"[\200-\377]"
)
def
escape8bit
(
s
):
if
_8bit
.
search
(
s
)
is
not
None
:
out
=
[]
for
c
in
s
:
o
=
ord
(
c
)
if
o
>=
128
:
out
.
append
(
"
\\
"
+
hex
(
o
)[
1
:])
else
:
out
.
append
(
c
)
s
=
""
.
join
(
out
)
return
s
def
test
():
def
test
():
input
=
"D:Development:THINK C:Mac #includes:Apple #includes:AppleEvents.h"
input
=
"D:Development:THINK C:Mac #includes:Apple #includes:AppleEvents.h"
output
=
"@aespecs.py"
output
=
"@aespecs.py"
...
...
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