diff lisp/progmodes/python.el @ 111665:946fe738ec2b

Highlight top-level augmented assignments in Python (Bug#6445). * progmodes/python.el (python-font-lock-keywords): Highlight top-level augmented assignments (Bug#6445).
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 21 Nov 2010 12:12:44 -0500
parents 3655cc4062e4
children 141d3f14d8c3
line wrap: on
line diff
--- a/lisp/progmodes/python.el	Sun Nov 21 10:46:23 2010 -0500
+++ b/lisp/progmodes/python.el	Sun Nov 21 12:12:44 2010 -0500
@@ -110,7 +110,8 @@
     (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_))))
      (1 font-lock-keyword-face) (2 font-lock-function-name-face))
     ;; Top-level assignments are worth highlighting.
-    (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=")
+    (,(rx line-start (group (1+ (or word ?_))) (0+ space)
+	  (opt (or "+" "-" "*" "**" "/" "//" "&" "%" "|" "^" "<<" ">>")) "=")
      (1 font-lock-variable-name-face))
     ;; Decorators.
     (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))