diff Misc/python-mode.el @ 15668:8b4ca5da7dc2 legacy-trunk

(python-font-lock-keywords): Add highlighting of `as' as a keyword, but only in "import foo as bar" statements (including optional preceding `from' clause).
author Barry Warsaw <barry@python.org>
date Wed, 27 Dec 2000 17:41:47 +0000
parents f480d52c0760
children 3e9396ac4ba0
line wrap: on
line diff
--- a/Misc/python-mode.el	Wed Dec 27 08:05:05 2000 +0000
+++ b/Misc/python-mode.el	Wed Dec 27 17:41:47 2000 +0000
@@ -332,6 +332,8 @@
      ;; 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)