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
0e10243d
Kaydet (Commit)
0e10243d
authored
Ock 02, 2017
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #29071: Use local flags for IDLE colorizer string prefix matcher.
Revised re by Serhiy Storchaka.
üst
e465a9af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
colorizer.py
Lib/idlelib/colorizer.py
+4
-4
No files found.
Lib/idlelib/colorizer.py
Dosyayı görüntüle @
0e10243d
...
...
@@ -21,8 +21,7 @@ def make_pat():
# 1st 'file' colorized normal, 2nd as builtin, 3rd as string
builtin
=
r"([^.'\"\\#]\b|^)"
+
any
(
"BUILTIN"
,
builtinlist
)
+
r"\b"
comment
=
any
(
"COMMENT"
,
[
r"#[^\n]*"
])
stringprefix
=
(
r"(\br|R|u|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF"
"|b|B|br|Br|bR|BR|rb|rB|Rb|RB)?"
)
stringprefix
=
r"(?i:\br|u|f|fr|rf|b|br|rb)?"
sqstring
=
stringprefix
+
r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
dqstring
=
stringprefix
+
r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
sq3string
=
stringprefix
+
r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
...
...
@@ -262,10 +261,11 @@ def _color_delegator(parent): # htest #
top
=
Toplevel
(
parent
)
top
.
title
(
"Test ColorDelegator"
)
x
,
y
=
map
(
int
,
parent
.
geometry
()
.
split
(
'+'
)[
1
:])
top
.
geometry
(
"
600x200+
%
d+
%
d"
%
(
x
+
10
0
,
y
+
175
))
top
.
geometry
(
"
700x250+
%
d+
%
d"
%
(
x
+
2
0
,
y
+
175
))
source
=
(
"# Following has syntax errors
\n
"
"if True: then int 1
\n
elif False: print 0
\n
else: float(None)
\n
"
"#unicode and byte strings, valid prefixes should be colored
\n
"
"if iF + If + IF: 'keywork matching must respect case'
\n
"
"# All valid prefixes for unicode and byte strings should be colored
\n
"
"'x', '''x''',
\"
x
\"
,
\"\"\"
x
\"\"\"\n
"
"r'x', u'x', R'x', U'x', f'x', F'x', ur'is invalid'
\n
"
"fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'
\n
"
...
...
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