Skip to content

Commit 8f8cff1

Browse files
committed
Add matcher for qualified names
qualified names are treated based on their last part: as an operator, identifier or typename
1 parent 1ced36e commit 8f8cff1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

syntax/haskell.vim

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contai
7171
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP,@Spell
7272
syn keyword haskellInfix infix infixl infixr
7373
syn keyword haskellBottom undefined error
74-
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
74+
syn match haskellOperators "\%([A-Z][a-zA-Z0-9_']*\.\)*[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>\|\<\.\>"
7575
syn match haskellQuote "\<'\+" contained
76-
syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained
77-
syn region haskellQuoted start="\<'\+" end="\>"
76+
syn match haskellQuotedType "\%([A-Z][a-zA-Z0-9_']*\.\)*[A-Z][a-zA-Z0-9_']*\>" contained
77+
syn region haskellQuoted start="\<'\+" end="\>" skip="\."
7878
\ contains=
7979
\ haskellType,
8080
\ haskellQuote,
@@ -90,9 +90,9 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
9090
syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*#\?`"
9191
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
9292
\ contains=@Spell
93-
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
93+
syn match haskellIdentifier "\%([A-Z][a-zA-Z_']*\.\)*[_a-z][a-zA-z0-9_']*" contained
9494
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
95-
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>"
95+
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\%(\.[A-Z][a-zA-Z0-9_']*\)*\.\@!\>"
9696
syn region haskellBlockComment start="{-" end="-}"
9797
\ contains=
9898
\ haskellBlockComment,

0 commit comments

Comments
 (0)