[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a3474c5: Highlight typed variables in Python
From: |
Eli Zaretskii |
Subject: |
master a3474c5: Highlight typed variables in Python |
Date: |
Sat, 13 Jun 2020 03:32:39 -0400 (EDT) |
branch: master
commit a3474c59dee35d687f773993869f84eb5f9d2eda
Author: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Commit: Eli Zaretskii <eliz@gnu.org>
Highlight typed variables in Python
* progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Recognize
typed variables like "foo: int = 1" as well. (Bug#41684)
---
lisp/progmodes/python.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1ca9f01..aec27a5 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -633,6 +633,8 @@ builtins.")
(,(lambda (limit)
(let ((re (python-rx (group (+ (any word ?. ?_)))
(? ?\[ (+ (not (any ?\]))) ?\]) (* space)
+ ;; A type, like " : int ".
+ (? ?: (* space) (+ (any word ?. ?_)) (* space))
assignment-operator))
(res nil))
(while (and (setq res (re-search-forward re limit t))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master a3474c5: Highlight typed variables in Python,
Eli Zaretskii <=