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
68d486c8
Kaydet (Commit)
68d486c8
authored
Şub 24, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
(py-parse-state): Teach python-mode how to scan code which follows
multi-line list comprehensions.
üst
1e542110
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
python-mode.el
Misc/python-mode.el
+11
-3
No files found.
Misc/python-mode.el
Dosyayı görüntüle @
68d486c8
...
@@ -60,8 +60,6 @@
...
@@ -60,8 +60,6 @@
;; - Better integration with pdb.py and gud-mode for debugging.
;; - Better integration with pdb.py and gud-mode for debugging.
;; - Rewrite according to GNU Emacs Lisp standards.
;; - Rewrite according to GNU Emacs Lisp standards.
;; - have py-execute-region on indented code act as if the region is
;; left justified. Avoids syntax errors.
;; - add a py-goto-block-down, bound to C-c C-d
;; - add a py-goto-block-down, bound to C-c C-d
;;; Code:
;;; Code:
...
@@ -2801,7 +2799,7 @@ local bindings to py-newline-and-indent."))
...
@@ -2801,7 +2799,7 @@ local bindings to py-newline-and-indent."))
"Return the parse state at point (see `parse-partial-sexp' docs)."
"Return the parse state at point (see `parse-partial-sexp' docs)."
(
save-excursion
(
save-excursion
(
let
((
here
(
point
))
(
let
((
here
(
point
))
pps
done
)
in-listcomp
pps
done
)
(
while
(
not
done
)
(
while
(
not
done
)
;; back up to the first preceding line (if any; else start of
;; back up to the first preceding line (if any; else start of
;; buffer) that begins with a popular Python keyword, or a
;; buffer) that begins with a popular Python keyword, or a
...
@@ -2810,6 +2808,13 @@ local bindings to py-newline-and-indent."))
...
@@ -2810,6 +2808,13 @@ local bindings to py-newline-and-indent."))
;; at a non-zero nesting level. It may be slow for people who
;; at a non-zero nesting level. It may be slow for people who
;; write huge code blocks or huge lists ... tough beans.
;; write huge code blocks or huge lists ... tough beans.
(
re-search-backward
py-parse-state-re
nil
'move
)
(
re-search-backward
py-parse-state-re
nil
'move
)
;; Watch out for landing inside a list comprehension
(
save-excursion
(
if
(
and
(
looking-at
"[ \t]*\\<\\(if\\|for\\)\\>"
)
(
py-safe
(
progn
(
up-list
-1
)
t
))
(
eq
(
char-after
)
?\[
))
(
setq
in-listcomp
(
point
))
(
setq
in-listcomp
nil
)))
(
beginning-of-line
)
(
beginning-of-line
)
;; In XEmacs, we have a much better way to test for whether
;; In XEmacs, we have a much better way to test for whether
;; we're in a triple-quoted string or not. Emacs does not
;; we're in a triple-quoted string or not. Emacs does not
...
@@ -2832,6 +2837,9 @@ local bindings to py-newline-and-indent."))
...
@@ -2832,6 +2837,9 @@ local bindings to py-newline-and-indent."))
;; XEmacs
;; XEmacs
(
setq
done
(
or
(
not
(
buffer-syntactic-context
))
(
setq
done
(
or
(
not
(
buffer-syntactic-context
))
(
bobp
)))
(
bobp
)))
(
when
in-listcomp
(
goto-char
in-listcomp
)
(
setq
done
nil
))
(
when
done
(
when
done
(
setq
pps
(
parse-partial-sexp
(
point
)
here
)))
(
setq
pps
(
parse-partial-sexp
(
point
)
here
)))
))
))
...
...
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