Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(haskell-font-lock-keywords-create):

Ignore-this: 5770f8277833b56312a84d5ce9c7aca4
(haskell-font-lock-keywords-create):
Remove qualified and hiding from the reserved identifiers.
Add a special rule for import statements.

darcs-hash:20070210080100-c2f2e-1a7ffdd483ad17dbecab347f72737cf5e013623e.gz
  • Loading branch information...
commit 1cb80d6ce7658b5962153eb71e5424b5ba70fa76 1 parent 054fc55
monnier authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 haskell-font-lock.el
View
19 haskell-font-lock.el
@@ -259,16 +259,15 @@ Returns keywords suitable for `font-lock-keywords'."
;; Reserved identifiers
(reservedid
(concat "\\<"
- ;; `as' and `qualified' are part of the import spec
- ;; syntax, but `as' doesn't seem to be reserved. Don't
- ;; know about `qualified'.
+ ;; `as', `hiding', and `qualified' are part of the import
+ ;; spec syntax, but they are not reserved.
;; `_' can go in here since it has temporary word syntax.
;; (regexp-opt
;; '("case" "class" "data" "default" "deriving" "do"
- ;; "else" "hiding" "if" "import" "in" "infix" "infixl"
- ;; "infixr" "instance" "let" "module" "newtype" "of"
- ;; "qualified" "then" "type" "where" "_") t)
- "\\(_\\|c\\(ase\\|lass\\)\\|d\\(ata\\|e\\(fault\\|riving\\)\\|o\\)\\|else\\|hiding\\|i\\(mport\\|n\\(fix[lr]?\\|stance\\)\\|[fn]\\)\\|let\\|module\\|newtype\\|of\\|qualified\\|t\\(hen\\|ype\\)\\|where\\)"
+ ;; "else" "if" "import" "in" "infix" "infixl"
+ ;; "infixr" "instance" "let" "module" "newtype" "of"
+ ;; "then" "type" "where" "_") t)
+ "\\(_\\|c\\(ase\\|lass\\)\\|d\\(ata\\|e\\(fault\\|riving\\)\\|o\\)\\|else\\|i\\(mport\\|n\\(fix[lr]?\\|stance\\)\\|[fn]\\)\\|let\\|module\\|newtype\\|of\\|t\\(hen\\|ype\\)\\|where\\)"
"\\>"))
;; This unreadable regexp matches strings and character
@@ -313,6 +312,12 @@ Returns keywords suitable for `font-lock-keywords'."
(,reservedid 1 (symbol-value 'haskell-keyword-face))
(,reservedsym 1 (symbol-value 'haskell-operator-face))
+ ;; Special case for `as', `hiding', and `qualified', which are
+ ;; keywords in import statements but are not otherwise reserved.
+ ("\\<import[ \t]+\\(?:\\(qualified\\>\\)[ \t]*\\)?[^ \t\n()]+[ \t]*\\(?:\\(\\<as\\>\\)[ \t]*[^ \t\n()]+[ \t]*\\)?\\(\\<hiding\\>\\)?"
+ (1 (symbol-value 'haskell-keyword-face) nil lax)
+ (2 (symbol-value 'haskell-keyword-face) nil lax)
+ (3 (symbol-value 'haskell-keyword-face) nil lax))
;; Toplevel Declarations.
;; Place them *before* generic id-and-op highlighting.
Please sign in to comment.
Something went wrong with that request. Please try again.