(python-font-lock-keywords): Add highlighting of `as' as a keyword,
but only in "import foo as bar" statements (including optional preceding `from' clause).
This commit is contained in:
parent
dd699b62c5
commit
e0c182fb5f
|
@ -332,6 +332,8 @@ support for features needed by `python-mode'.")
|
||||||
;; block introducing keywords with immediately following colons.
|
;; block introducing keywords with immediately following colons.
|
||||||
;; Yes "except" is in both lists.
|
;; Yes "except" is in both lists.
|
||||||
(cons (concat "\\b\\(" kw2 "\\)[ \n\t(]") 1)
|
(cons (concat "\\b\\(" kw2 "\\)[ \n\t(]") 1)
|
||||||
|
;; `as' but only in "import foo as bar"
|
||||||
|
'("[ \t]*\\(\\bfrom\\b.*\\)?\\bimport\\b.*\\b\\(as\\)\\b" . 2)
|
||||||
;; 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…
Reference in New Issue