summaryrefslogtreecommitdiffstats
path: root/syntax/haskell.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-12-20 20:57:20 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2016-12-20 20:57:20 +0100
commite404a658b1647fad396a954776eda0bdabf8353c (patch)
treefcdab0e324fd72015ba656e43bd8f8c243030c14 /syntax/haskell.vim
parent74652b465d7eff97070001317a4ea5557717378d (diff)
downloadvim-polyglot-e404a658b1647fad396a954776eda0bdabf8353c.tar.gz
vim-polyglot-e404a658b1647fad396a954776eda0bdabf8353c.zip
Update
Diffstat (limited to 'syntax/haskell.vim')
-rw-r--r--syntax/haskell.vim16
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