Skip to content

Commit d876a1c

Browse files
raichooraichoo
authored and
raichoo
committed
add "deriving via" support
1 parent f151dfc commit d876a1c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

syntax/haskell.vim

+8-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ syn match haskellTypeSig
3636
\ haskellParens
3737
syn keyword haskellWhere where
3838
syn keyword haskellLet let
39-
syn match HaskellDerive "\<deriving\>\(\s\+\<\(anyclass\|instance\|newtype\|stock\)\>\)\?"
39+
syn keyword haskellDeriveKeyword deriving anyclass instance newtype stock via contained
40+
syn match haskellDerive "deriving\(\s\+instance\)\?\(\s\+anyclass\|\s\+newtype\|\s\+stock\|\s\+.\{-}\_s\+via\)\?"
41+
\ contains=
42+
\ haskellDeriveKeyword,
43+
\ haskellParens,
44+
\ haskellType
4045
syn keyword haskellDeclKeyword module class instance newtype in
4146
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
4247
syn keyword haskellDefault default
@@ -161,13 +166,13 @@ highlight def link haskellType Type
161166
highlight def link haskellImportKeywords Include
162167
if get(g:, 'haskell_classic_highlighting', 0)
163168
highlight def link haskellDeclKeyword Keyword
164-
highlight def link HaskellDerive Keyword
169+
highlight def link haskellDeriveKeyword Keyword
165170
highlight def link haskellDecl Keyword
166171
highlight def link haskellWhere Keyword
167172
highlight def link haskellLet Keyword
168173
else
169174
highlight def link haskellDeclKeyword Structure
170-
highlight def link HaskellDerive Structure
175+
highlight def link haskellDeriveKeyword Structure
171176
highlight def link haskellDecl Structure
172177
highlight def link haskellWhere Structure
173178
highlight def link haskellLet Structure

0 commit comments

Comments
 (0)