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
43ecf8ee
Kaydet (Commit)
43ecf8ee
authored
Nis 06, 1996
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
(py-parse-state): make sure we don't land inside a triple-quoted
string
üst
ab69eb96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
python-mode.el
Misc/python-mode.el
+16
-10
No files found.
Misc/python-mode.el
Dosyayı görüntüle @
43ecf8ee
...
...
@@ -1752,16 +1752,22 @@ local bindings to py-newline-and-indent."))
;; returns the parse state at point (see parse-partial-sexp docs)
(
defun
py-parse-state
()
(
save-excursion
(
let
((
here
(
point
))
)
;; back up to the first preceding line (if any; else start of
;; buffer) that begins with a popular Python keyword, or a non-
;; whitespace and non-comment character. These are good places
;; to start parsing to see whether where we started is at a
;; non-zero nesting level. It may be slow for people who write
;; huge code blocks or huge lists ... tough beans.
(
re-search-backward
py-parse-state-re
nil
'move
)
(
beginning-of-line
)
(
parse-partial-sexp
(
point
)
here
))))
(
let
((
here
(
point
))
pps
done
)
(
while
(
not
done
)
;; back up to the first preceding line (if any; else start of
;; buffer) that begins with a popular Python keyword, or a
;; non- whitespace and non-comment character. These are good
;; places to start parsing to see whether where we started is
;; at a non-zero nesting level. It may be slow for people who
;; write huge code blocks or huge lists ... tough beans.
(
re-search-backward
py-parse-state-re
nil
'move
)
(
beginning-of-line
)
(
save-excursion
(
setq
pps
(
parse-partial-sexp
(
point
)
here
)))
;; make sure we don't land inside a triple-quoted string
(
setq
done
(
or
(
not
(
nth
3
pps
))
(
bobp
))))
pps
)))
;; if point is at a non-zero nesting level, returns the number of the
;; character that opens the smallest enclosing unclosed list; else
...
...
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