@@ -36,7 +36,12 @@ syn match haskellTypeSig
3636 \ haskellParens
3737syn keyword haskellWhere where
3838syn 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
4045syn keyword haskellDeclKeyword module class instance newtype in
4146syn match haskellDecl " \<\( type\| data\)\>\s\+\(\< family\>\)\? "
4247syn keyword haskellDefault default
@@ -161,13 +166,13 @@ highlight def link haskellType Type
161166highlight def link haskellImportKeywords Include
162167if 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
168173else
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