mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
(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
1 changed files with 2 additions and 0 deletions
|
@ -332,6 +332,8 @@ support for features needed by `python-mode'.")
|
|||
;; block introducing keywords with immediately following colons.
|
||||
;; Yes "except" is in both lists.
|
||||
(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
|
||||
'("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
|
||||
1 font-lock-type-face)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue