Fix haskell.vim syntax
6ec8f5208c20b2e8531fdc2648859a5cb78b80b9
1 parent
a9e58ee2
.vim/syntax/haskell.vim
+7 -3
| 43 | 43 | syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" |
|
| 44 | 44 | syn match hsSpecialCharError contained "\\&\|'''\+" |
|
| 45 | 45 | sy region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@Spell |
|
| 46 | 46 | sy match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError |
|
| 47 | 47 | sy match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError |
|
| 48 | + | sy match hsOpFunctionName "(\(\W\&[^(),\"]\)\+)" contained |
|
| 49 | + | sy match hsHlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained |
|
| 50 | + | ||
| 51 | + | ||
| 48 | 52 | ||
| 49 | 53 | " (Qualified) identifiers (no default highlighting) |
|
| 50 | 54 | syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>" |
|
| 51 | 55 | syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>" |
|
| 52 | 56 |
| 95 | 99 | \ nextgroup=hsImportParams,hsImportIllegal skipwhite |
|
| 96 | 100 | sy match hsImportParams "hiding" contained |
|
| 97 | 101 | \ contains=hsHidingLabel |
|
| 98 | 102 | \ nextgroup=hsImportParams,hsImportIllegal skipwhite |
|
| 99 | 103 | sy region hsImportParams start="(" end=")" contained |
|
| 100 | - | \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName |
|
| 104 | + | \ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hsHlFunctionName,hsOpFunctionName |
|
| 101 | 105 | \ nextgroup=hsImportIllegal skipwhite |
|
| 102 | 106 | ||
| 103 | 107 | " new module highlighting |
|
| 104 | 108 | syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained |
|
| 105 | 109 | \ contains=hsType |
| 122 | 126 | \ contains=hsCommentTodo,@Spell contained |
|
| 123 | 127 | \ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl |
|
| 124 | 128 | ||
| 125 | 129 | syn region hsModuleExports start="(" end=")" contained |
|
| 126 | 130 | \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl |
|
| 127 | - | \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule,hsPattern |
|
| 131 | + | \ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hsHlFunctionName,hsOpFunctionName,hsExportModule,hsPattern |
|
| 128 | 132 | ||
| 129 | 133 | syn match hsModuleCommentB "--.*\n" |
|
| 130 | 134 | \ contains=hsCommentTodo,@Spell contained |
|
| 131 | 135 | \ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl |
|
| 132 | 136 |
| 142 | 146 | sy keyword hsFFICallConvention ccall stdcall contained |
|
| 143 | 147 | sy keyword hsFFISafety safe unsafe contained |
|
| 144 | 148 | sy region hsFFIString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=hsSpecialChar |
|
| 145 | 149 | sy match hsFFI excludenl "\<foreign\>\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::" |
|
| 146 | 150 | \ keepend |
|
| 147 | - | \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName |
|
| 151 | + | \ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hsOpFunctionName,hsHlFunctionName |
|
| 148 | 152 | ||
| 149 | 153 | ||
| 150 | 154 | sy match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" |
|
| 151 | 155 | sy match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" |
|
| 152 | 156 |