diff options
Diffstat (limited to '')
-rw-r--r-- | syntax/haskell.vim | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/syntax/haskell.vim b/syntax/haskell.vim index b35c0225..1f0f905a 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -13,6 +13,10 @@ elseif exists("b:current_syntax") finish endif +if !exists('g:haskell_disable_TH') + let g:haskell_disable_TH = 0 +endif + syn spell notoplevel syn match haskellRecordField contained containedin=haskellBlock \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" @@ -82,7 +86,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" \ contains= \ haskellTodo, \ @Spell -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 match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained @@ -94,14 +98,16 @@ syn region haskellBlockComment start="{-" end="-}" \ haskellTodo, \ @Spell syn region haskellPragma start="{-#" end="#-}" -syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained -syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]" -syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP -syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP syn match haskellPreProc "^#.*$" syn keyword haskellTodo TODO FIXME contained " Treat a shebang line at the start of the file as a comment syn match haskellShebang "\%^#!.*$" +if exists('g:haskell_disable_TH') && g:haskell_disable_TH == 0 + syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained + syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]" + syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP + syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP +endif if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1 syn keyword haskellTypeRoles phantom representational nominal contained syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend |