better identifier and type highlighting

This commit is contained in:
raichoo 2014-09-19 21:24:32 +02:00
parent df038c9ce2
commit 1d90cb1382

View file

@ -35,14 +35,14 @@ syn keyword haskellInfix infix infixl infixr
syn keyword haskellBottom undefined error
syn match haskellOperators "\([-!#$%&\*\+/<=>\?@\\^|~:]\|\<_\>\)"
syn match haskellDot "\."
syn match haskellType "\<[A-Z][a-zA-Z0-9_]*\>"
syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell
syn match haskellChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'"
syn match haskellBacktick "`[A-Za-z][A-Za-z0-9_\.]*\('\)*`"
syn match haskellBacktick "`[A-Za-z][A-Za-z0-9_\.]*'*`"
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
syn region haskellBlockComment start="{-" end="-}" contains=haskellBlockComment,@Spell
syn match haskellIdentifier "[_a-z][a-zA-z0-9_]*\('\)*" contained
syn match haskellTopLevelDecl "^\s*[_a-z][a-zA-z0-9_]*\('\)*\s*::" contains=haskellIdentifier,haskellOperators
syn match haskellIdentifier "[_a-z][a-zA-z0-9_]*'*" contained
syn match haskellType "[A-Z][a-zA-Z0-9_]*'*"
syn match haskellTopLevelDecl "^\s*[_a-z][a-zA-z0-9_]*'*\s*::" contains=haskellIdentifier,haskellOperators
if exists('g:haskell_enable_typeroles')
syn keyword haskellTypeRoles type role phantom representational nominal contained