aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el29
1 files changed, 12 insertions, 17 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 01833ffd70b..7004836e69f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -501,29 +501,24 @@ The type returned can be `comment', `string' or `paren'."
501 (,(lambda (limit) 501 (,(lambda (limit)
502 (let ((re (python-rx (group (+ (any word ?. ?_))) 502 (let ((re (python-rx (group (+ (any word ?. ?_)))
503 (? ?\[ (+ (not (any ?\]))) ?\]) (* space) 503 (? ?\[ (+ (not (any ?\]))) ?\]) (* space)
504 assignment-operator))) 504 assignment-operator))
505 (when (re-search-forward re limit t) 505 (res nil))
506 (while (and (python-syntax-context 'paren) 506 (while (and (setq res (re-search-forward re limit t))
507 (re-search-forward re limit t))) 507 (or (python-syntax-context 'paren)
508 (if (not (or (python-syntax-context 'paren) 508 (equal (char-after (point-marker)) ?=))))
509 (equal (char-after (point-marker)) ?=))) 509 res))
510 t
511 (set-match-data nil)))))
512 (1 font-lock-variable-name-face nil nil)) 510 (1 font-lock-variable-name-face nil nil))
513 ;; support for a, b, c = (1, 2, 3) 511 ;; support for a, b, c = (1, 2, 3)
514 (,(lambda (limit) 512 (,(lambda (limit)
515 (let ((re (python-rx (group (+ (any word ?. ?_))) (* space) 513 (let ((re (python-rx (group (+ (any word ?. ?_))) (* space)
516 (* ?, (* space) (+ (any word ?. ?_)) (* space)) 514 (* ?, (* space) (+ (any word ?. ?_)) (* space))
517 ?, (* space) (+ (any word ?. ?_)) (* space) 515 ?, (* space) (+ (any word ?. ?_)) (* space)
518 assignment-operator))) 516 assignment-operator))
519 (when (and (re-search-forward re limit t) 517 (res nil))
520 (goto-char (nth 3 (match-data)))) 518 (while (and (setq res (re-search-forward re limit t))
521 (while (and (python-syntax-context 'paren) 519 (goto-char (match-end 1))
522 (re-search-forward re limit t)) 520 (python-syntax-context 'paren)))
523 (goto-char (nth 3 (match-data)))) 521 res))
524 (if (not (python-syntax-context 'paren))
525 t
526 (set-match-data nil)))))
527 (1 font-lock-variable-name-face nil nil)))) 522 (1 font-lock-variable-name-face nil nil))))
528 523
529(defconst python-syntax-propertize-function 524(defconst python-syntax-propertize-function