comparison 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
comparison
equal deleted inserted replaced
111664:783897103aeb 111665:946fe738ec2b
108 (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_)))) 108 (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_))))
109 (1 font-lock-keyword-face) (2 font-lock-type-face)) 109 (1 font-lock-keyword-face) (2 font-lock-type-face))
110 (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_)))) 110 (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_))))
111 (1 font-lock-keyword-face) (2 font-lock-function-name-face)) 111 (1 font-lock-keyword-face) (2 font-lock-function-name-face))
112 ;; Top-level assignments are worth highlighting. 112 ;; Top-level assignments are worth highlighting.
113 (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=") 113 (,(rx line-start (group (1+ (or word ?_))) (0+ space)
114 (opt (or "+" "-" "*" "**" "/" "//" "&" "%" "|" "^" "<<" ">>")) "=")
114 (1 font-lock-variable-name-face)) 115 (1 font-lock-variable-name-face))
115 ;; Decorators. 116 ;; Decorators.
116 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_)) 117 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))
117 (0+ "." (1+ (or word ?_))))) 118 (0+ "." (1+ (or word ?_)))))
118 (1 font-lock-type-face)) 119 (1 font-lock-type-face))