mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
(python-font-lock-keywords): Fix for consecutive keyword font locking,
given by Sjoerd Mullender <Sjoerd.Mullender@cwi.nl>.
This commit is contained in:
parent
5e21cb0bfb
commit
ef3c891773
1 changed files with 2 additions and 6 deletions
|
@ -257,12 +257,8 @@ features supporting those needed by CC Mode.")
|
||||||
))
|
))
|
||||||
(kwregex (mapconcat 'identity keywords "\\|")))
|
(kwregex (mapconcat 'identity keywords "\\|")))
|
||||||
(list
|
(list
|
||||||
;; keywords not at beginning of line
|
;; keywords
|
||||||
(cons (concat "\\s-\\(" kwregex "\\)[ \n\t(]") 1)
|
(cons (concat "\\b\\(" kwregex "\\)\\b[ \n\t(]") 1)
|
||||||
;; keywords at beginning of line. i don't think regexps are
|
|
||||||
;; powerful enough to handle these two cases in one regexp.
|
|
||||||
;; prove me wrong!
|
|
||||||
(cons (concat "^\\(" kwregex "\\)[ \n\t(]") 1)
|
|
||||||
;; classes
|
;; classes
|
||||||
'("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
|
'("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
|
||||||
1 font-lock-type-face)
|
1 font-lock-type-face)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue