(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:
Barry Warsaw 2000-12-27 17:41:47 +00:00
parent dd699b62c5
commit e0c182fb5f
1 changed files with 2 additions and 0 deletions

View File

@ -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)