Skip to content

Commit cbbb779

Browse files
committed
Merge pull request #1056 from bergey/type-data-family
Add font lock type/data family declarations
2 parents 58b603a + 3b9e6ed commit cbbb779

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

haskell-doc.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ It is probably best to manipulate this data structure with the commands
485485
("where" . "exp where { decl; ...; decl [;] }") ; check that ; see also class, instance, module
486486
("as" . "import [qualified] modid [as modid] [impspec]")
487487
("qualified" . "import [qualified] modid [as modid] [impspec]")
488-
("hiding" . "hiding ( import1 , ... , importn [ , ] )"))
488+
("hiding" . "hiding ( import1 , ... , importn [ , ] )")
489+
("family" . "(type family type [kind] [= type_fam_equations]) | (data family type [kind])"))
489490
"An alist of reserved identifiers.
490491
Each element is of the form (ID . DOC) where both ID and DOC are strings.
491492
DOC should be a concise single-line string describing the construct in which

haskell-font-lock.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,12 @@ Returns keywords suitable for `font-lock-keywords'."
284284
(2 'haskell-keyword-face nil lax)
285285
(3 'haskell-keyword-face nil lax))
286286

287+
;; Special case for `type family' and `data family'.
288+
;; `family' is only reserved in these contexts.
289+
("\\<\\(type\\|data\\)[ \t]+\\(family\\>\\)"
290+
(1 'haskell-keyword-face nil lax)
291+
(2 'haskell-keyword-face nil lax))
292+
287293
;; Toplevel Declarations.
288294
;; Place them *before* generic id-and-op highlighting.
289295
(,topdecl-var (1 'haskell-definition-face))

0 commit comments

Comments
 (0)