Skip to content

Add font lock type/data family declarations #1056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion haskell-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ It is probably best to manipulate this data structure with the commands
("where" . "exp where { decl; ...; decl [;] }") ; check that ; see also class, instance, module
("as" . "import [qualified] modid [as modid] [impspec]")
("qualified" . "import [qualified] modid [as modid] [impspec]")
("hiding" . "hiding ( import1 , ... , importn [ , ] )"))
("hiding" . "hiding ( import1 , ... , importn [ , ] )")
("family" . "(type family type [kind] [= type_fam_equations]) | (data family type [kind])"))
"An alist of reserved identifiers.
Each element is of the form (ID . DOC) where both ID and DOC are strings.
DOC should be a concise single-line string describing the construct in which
Expand Down
6 changes: 6 additions & 0 deletions haskell-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ Returns keywords suitable for `font-lock-keywords'."
(2 'haskell-keyword-face nil lax)
(3 'haskell-keyword-face nil lax))

;; Special case for `type family' and `data family'.
;; `family' is only reserved in these contexts.
("\\<\\(type\\|data\\)[ \t]+\\(family\\>\\)"
(1 'haskell-keyword-face nil lax)
(2 'haskell-keyword-face nil lax))

;; Toplevel Declarations.
;; Place them *before* generic id-and-op highlighting.
(,topdecl-var (1 'haskell-definition-face))
Expand Down