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
b61602c9
Kaydet (Commit)
b61602c9
authored
Kas 15, 2005
tarafından
Kurt B. Kaiser
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Better indentation after first line of string continuation.
IDLEfork Patch 681992, Noam Raphael
üst
6b347890
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
EditorWindow.py
Lib/idlelib/EditorWindow.py
+6
-2
NEWS.txt
Lib/idlelib/NEWS.txt
+3
-0
PyParse.py
Lib/idlelib/PyParse.py
+11
-3
No files found.
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
b61602c9
...
...
@@ -1078,8 +1078,12 @@ class EditorWindow(object):
c
=
y
.
get_continuation_type
()
if
c
!=
PyParse
.
C_NONE
:
# The current stmt hasn't ended yet.
if
c
==
PyParse
.
C_STRING
:
# inside a string; just mimic the current indent
if
c
==
PyParse
.
C_STRING_FIRST_LINE
:
# after the first line of a string; do not indent at all
pass
elif
c
==
PyParse
.
C_STRING_NEXT_LINES
:
# inside a string which started before this line;
# just mimic the current indent
text
.
insert
(
"insert"
,
indent
)
elif
c
==
PyParse
.
C_BRACKET
:
# line up with the first (if any) element of the
...
...
Lib/idlelib/NEWS.txt
Dosyayı görüntüle @
b61602c9
...
...
@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0?
*Release date: XX-XXX-2005*
- Better indentation after first line of string continuation.
IDLEfork Patch 681992, Noam Raphael
- Fixed CodeContext alignment problem, following suggestion from Tal Einat.
- Increased performance in CodeContext extension Patch 936169 Noam Raphael
...
...
Lib/idlelib/PyParse.py
Dosyayı görüntüle @
b61602c9
...
...
@@ -2,7 +2,8 @@ import re
import
sys
# Reason last stmt is continued (or C_NONE if it's not).
C_NONE
,
C_BACKSLASH
,
C_STRING
,
C_BRACKET
=
range
(
4
)
(
C_NONE
,
C_BACKSLASH
,
C_STRING_FIRST_LINE
,
C_STRING_NEXT_LINES
,
C_BRACKET
)
=
range
(
5
)
if
0
:
# for throwaway debugging output
def
dump
(
*
stuff
):
...
...
@@ -281,6 +282,7 @@ class Parser:
quote
=
ch
if
str
[
i
-
1
:
i
+
2
]
==
quote
*
3
:
quote
=
quote
*
3
firstlno
=
lno
w
=
len
(
quote
)
-
1
i
=
i
+
w
while
i
<
n
:
...
...
@@ -315,7 +317,12 @@ class Parser:
else
:
# didn't break out of the loop, so we're still
# inside a string
continuation
=
C_STRING
if
(
lno
-
1
)
==
firstlno
:
# before the previous \n in str, we were in the first
# line of the string
continuation
=
C_STRING_FIRST_LINE
else
:
continuation
=
C_STRING_NEXT_LINES
continue
# with outer loop
if
ch
==
'#'
:
...
...
@@ -335,7 +342,8 @@ class Parser:
# The last stmt may be continued for all 3 reasons.
# String continuation takes precedence over bracket
# continuation, which beats backslash continuation.
if
continuation
!=
C_STRING
and
level
>
0
:
if
(
continuation
!=
C_STRING_FIRST_LINE
and
continuation
!=
C_STRING_NEXT_LINES
and
level
>
0
):
continuation
=
C_BRACKET
self
.
continuation
=
continuation
...
...
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