From 1ced36ee0eeecbf7685098bf5ec108bb6a278559 Mon Sep 17 00:00:00 2001 From: d86leader Date: Tue, 8 Sep 2020 16:23:18 +0700 Subject: [PATCH 1/3] Add XXX as todo keyword --- syntax/haskell.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/haskell.vim b/syntax/haskell.vim index f59a766..e856510 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -101,7 +101,7 @@ syn region haskellBlockComment start="{-" end="-}" syn region haskellPragma start="{-#" end="#-}" syn region haskellLiquid start="{-@" end="@-}" syn match haskellPreProc "^#.*$" -syn keyword haskellTodo TODO FIXME contained +syn keyword haskellTodo TODO FIXME XXX contained " Treat a shebang line at the start of the file as a comment syn match haskellShebang "\%^#!.*$" if !get(g:, 'haskell_disable_TH', 0) From 8f8cff179d012eebcf33eec0fc889524bde65c2c Mon Sep 17 00:00:00 2001 From: d86leader Date: Tue, 8 Sep 2020 16:27:58 +0700 Subject: [PATCH 2/3] Add matcher for qualified names qualified names are treated based on their last part: as an operator, identifier or typename --- syntax/haskell.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/syntax/haskell.vim b/syntax/haskell.vim index e856510..ef2e7ce 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -71,10 +71,10 @@ syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contai syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP,@Spell syn keyword haskellInfix infix infixl infixr syn keyword haskellBottom undefined error -syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>" +syn match haskellOperators "\%([A-Z][a-zA-Z0-9_']*\.\)*[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>\|\<\.\>" syn match haskellQuote "\<'\+" contained -syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained -syn region haskellQuoted start="\<'\+" end="\>" +syn match haskellQuotedType "\%([A-Z][a-zA-Z0-9_']*\.\)*[A-Z][a-zA-Z0-9_']*\>" contained +syn region haskellQuoted start="\<'\+" end="\>" skip="\." \ contains= \ haskellType, \ haskellQuote, @@ -90,9 +90,9 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" 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 +syn match haskellIdentifier "\%([A-Z][a-zA-Z_']*\.\)*[_a-z][a-zA-z0-9_']*" contained syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>" -syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>" +syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\%(\.[A-Z][a-zA-Z0-9_']*\)*\.\@!\>" syn region haskellBlockComment start="{-" end="-}" \ contains= \ haskellBlockComment, From 5c29efa801dd28435d026ba1e02271580e424cdd Mon Sep 17 00:00:00 2001 From: d86leader Date: Sat, 12 Jun 2021 21:20:42 +0700 Subject: [PATCH 3/3] Fixed dot not being highlighted; identifiers no longer can be qualified --- syntax/haskell.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/haskell.vim b/syntax/haskell.vim index bbc74dd..d753351 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -76,7 +76,7 @@ syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contai syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP,@Spell syn keyword haskellInfix infix infixl infixr syn keyword haskellBottom undefined error -syn match haskellOperators "\%([A-Z][a-zA-Z0-9_']*\.\)*[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>\|\<\.\>" +syn match haskellOperators "\%([A-Z][a-zA-Z0-9_']*\.\)*[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>\|\k\@" contained syn region haskellQuoted start="\<'\+" end="\>" skip="\." @@ -95,7 +95,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" 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_']*\.\)*[_a-z][a-zA-z0-9_']*" contained +syn match haskellIdentifier "[_a-z][a-zA-Z0-9_']*" contained syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>" syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\%(\.[A-Z][a-zA-Z0-9_']*\)*\.\@!\>" syn region haskellBlockComment start="{-" end="-}"