Mercurial > vim
comparison runtime/syntax/cs.vim @ 23047:29c5f168c6fd
Update runtime files
Commit: https://github.com/vim/vim/commit/23515b4ef7580af8b9d3b964a558ab2007cacda5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 29 14:36:24 2020 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 29 Nov 2020 14:45:04 +0100 |
parents | 51bc26d4a393 |
children | c58baa6d6dda |
comparison
equal
deleted
inserted
replaced
23046:9a30b28b8154 | 23047:29c5f168c6fd |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: C# | 2 " Language: C# |
3 " Maintainer: Nick Jensen <nickspoon@gmail.com> | 3 " Maintainer: Nick Jensen <nickspoon@gmail.com> |
4 " Former Maintainers: Anduin Withers <awithers@anduin.com> | 4 " Former Maintainers: Anduin Withers <awithers@anduin.com> |
5 " Johannes Zellner <johannes@zellner.org> | 5 " Johannes Zellner <johannes@zellner.org> |
6 " Last Change: 2020-01-27 | 6 " Last Change: 2020-11-23 |
7 " Filenames: *.cs | 7 " Filenames: *.cs |
8 " License: Vim (see :h license) | 8 " License: Vim (see :h license) |
9 " Repository: https://github.com/nickspoons/vim-cs | 9 " Repository: https://github.com/nickspoons/vim-cs |
10 " | 10 " |
11 " REFERENCES: | 11 " REFERENCES: |
15 finish | 15 finish |
16 endif | 16 endif |
17 | 17 |
18 let s:save_cpo = &cpoptions | 18 let s:save_cpo = &cpoptions |
19 set cpoptions&vim | 19 set cpoptions&vim |
20 | |
21 | 20 |
22 syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic | 21 syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic |
23 syn keyword csStorage delegate enum interface namespace struct | 22 syn keyword csStorage delegate enum interface namespace struct |
24 syn keyword csRepeat break continue do for foreach goto return while | 23 syn keyword csRepeat break continue do for foreach goto return while |
25 syn keyword csConditional else if switch | 24 syn keyword csConditional else if switch |
26 syn keyword csLabel case default | 25 syn keyword csLabel case default |
27 syn match csOperatorError display +::+ | 26 syn match csOperatorError display +::+ |
28 syn match csGlobal display +global::+ | 27 syn match csGlobal display +global::+ |
29 " user labels (see [1] 8.6 Statements) | 28 " user labels (see [1] 8.6 Statements) |
30 syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+ | 29 syn match csLabel display +^\s*\I\i*\s*:\%([^:]\)\@=+ |
31 syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile | 30 syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile |
32 syn keyword csConstant false null true | 31 syn keyword csConstant false null true |
33 syn keyword csException try catch finally throw when | 32 syn keyword csException try catch finally throw when |
34 syn keyword csLinq ascending by descending equals from group in into join let on orderby select where | 33 syn keyword csLinq ascending by descending equals from group in into join let on orderby select where |
35 syn keyword csAsync async await | 34 syn keyword csAsync async await |
37 syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this unchecked unsafe using | 36 syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this unchecked unsafe using |
38 syn keyword csUnsupportedStatement add remove value | 37 syn keyword csUnsupportedStatement add remove value |
39 syn keyword csUnspecifiedKeyword explicit implicit | 38 syn keyword csUnspecifiedKeyword explicit implicit |
40 | 39 |
41 " Contextual Keywords | 40 " Contextual Keywords |
42 syn match csContextualStatement /\<yield[[:space:]\n]\+\(return\|break\)/me=s+5 | 41 syn match csContextualStatement /\<yield[[:space:]\n]\+\%(return\|break\)/me=s+5 |
43 syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7 | 42 syn match csContextualStatement /\<partial[[:space:]\n]\+\%(class\|struct\|interface\)/me=s+7 |
44 syn match csContextualStatement /\<\(get\|set\)\(;\|[[:space:]\n]*{\)/me=s+3 | 43 syn match csContextualStatement /\<\%(get\|set\)\%(;\|[[:space:]\n]*{\)/me=s+3 |
44 syn match csContextualStatement /\<\%(get\|set\)\s*=>/me=s+3 | |
45 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5 | 45 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5 |
46 | 46 |
47 " Operators | 47 " Operators |
48 syn keyword csTypeOf typeof contained | 48 syn keyword csTypeOf typeof contained |
49 syn region csTypeOfStatement start="typeof(" end=")" contains=csType, csTypeOf | 49 syn region csTypeOfStatement start="typeof(" end=")" contains=csType, csTypeOf |
99 | 99 |
100 " Since syntax/xml.vim contains `syn spell toplevel`, we need to set it back to `default` here. | 100 " Since syntax/xml.vim contains `syn spell toplevel`, we need to set it back to `default` here. |
101 syn spell default | 101 syn spell default |
102 | 102 |
103 " [1] 9.5 Pre-processing directives | 103 " [1] 9.5 Pre-processing directives |
104 syn region csPreCondit start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)" skip="\\$" end="$" contains=csComment keepend | 104 syn region csPreCondit start="^\s*#\s*\%(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\|pragma\)\>" skip="\\$" end="$" contains=csComment keepend |
105 syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" end="^\s*#\s*endregion" transparent fold contains=TOP | 105 syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" end="^\s*#\s*endregion" transparent fold contains=TOP |
106 syn region csSummary start="^\s*/// <summary" end="^\%\(\s*///\)\@!" transparent fold keepend | 106 syn region csSummary start="^\s*/// <summary" end="^\%\(\s*///\)\@!" transparent fold keepend |
107 | 107 |
108 | 108 |
109 syn region csClassType start="@\@1<!\<class\>"hs=s+6 end="[:\n{]"me=e-1 contains=csClass | 109 syn region csClassType start="@\@1<!\<class\>"hs=s+6 end="[:\n{]"me=e-1 contains=csClass |
118 " Strings and constants | 118 " Strings and constants |
119 syn match csSpecialError "\\." contained | 119 syn match csSpecialError "\\." contained |
120 syn match csSpecialCharError "[^']" contained | 120 syn match csSpecialCharError "[^']" contained |
121 " [1] 9.4.4.4 Character literals | 121 " [1] 9.4.4.4 Character literals |
122 syn match csSpecialChar +\\["\\'0abfnrtvx]+ contained display | 122 syn match csSpecialChar +\\["\\'0abfnrtvx]+ contained display |
123 syn match csUnicodeNumber +\\x\x\{2,4}+ contained contains=csUnicodeSpecifier display | |
123 syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier display | 124 syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier display |
124 syn match csUnicodeNumber +\\U\x\{8}+ contained contains=csUnicodeSpecifier display | 125 syn match csUnicodeNumber +\\U\x\{8}+ contained contains=csUnicodeSpecifier display |
125 syn match csUnicodeSpecifier +\\[uU]+ contained display | 126 syn match csUnicodeSpecifier +\\[uU]+ contained display |
126 | 127 |
127 syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell | 128 syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell |
128 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError display | 129 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError,csUnicodeNumber display |
129 syn match csCharacter "'\\''" contains=csSpecialChar display | 130 syn match csCharacter "'\\''" contains=csSpecialChar display |
130 syn match csCharacter "'[^\\]'" display | 131 syn match csCharacter "'[^\\]'" display |
131 syn match csNumber "\<0[0-7]*[lL]\=\>" display | 132 syn match csNumber "\<0[0-7]*[lL]\=\>" display |
132 syn match csNumber "\<0[xX]\x\+[lL]\=\>" display | 133 syn match csNumber "\<0[xX][[:xdigit:]_]\+[lL]\=\>" display |
133 syn match csNumber "\<\d\+[lL]\=\>" display | 134 syn match csNumber "\<0[bB][01_]\+[lL]\=\>" display |
134 syn match csNumber "\<\d\+\.\d*\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display | 135 syn match csNumber "\<[[:digit:]_]\+[lL]\=\>" display |
135 syn match csNumber "\.\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display | 136 syn match csNumber "\<[[:digit:]_]\+\.[[:digit:]_]*\%\([eE][-+]\=[[:digit:]_]\+\)\=[fFdDmM]\=" display |
136 syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" display | 137 syn match csNumber "\.[[:digit:]_]\+\%\([eE][-+]\=[[:digit:]_]\+\)\=[fFdDmM]\=" display |
137 syn match csNumber "\<\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\>" display | 138 syn match csNumber "\<[[:digit:]_]\+[eE][-+]\=[[:digit:]_]\+[fFdDmM]\=\>" display |
138 | 139 syn match csNumber "\<[[:digit:]_]\+\%\([eE][-+]\=[[:digit:]_]\+\)\=[fFdDmM]\>" display |
139 syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ end=+$+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell | 140 |
140 | 141 syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell |
141 syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBracketed,csInterpolationAlign,csInterpolationFormat | 142 |
143 syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBraced,csBracketed,csInterpolationAlign,csInterpolationFormat | |
142 syn match csEscapedInterpolation "{{" transparent contains=NONE display | 144 syn match csEscapedInterpolation "{{" transparent contains=NONE display |
143 syn match csEscapedInterpolation "}}" transparent contains=NONE display | 145 syn match csEscapedInterpolation "}}" transparent contains=NONE display |
144 syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=csNumber,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display | 146 syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=csNumber,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display |
145 syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFormatDel display | 147 syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFormatDel display |
146 syn match csInterpolationAlignDel +,+ contained display | 148 syn match csInterpolationAlignDel +,+ contained display |
150 syn match csVerbatimQuote +""+ contained | 152 syn match csVerbatimQuote +""+ contained |
151 syn match csQuoteError +@$"+he=s+2,me=s+2 | 153 syn match csQuoteError +@$"+he=s+2,me=s+2 |
152 | 154 |
153 syn region csInterVerbString matchgroup=csQuote start=+\$@"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell | 155 syn region csInterVerbString matchgroup=csQuote start=+\$@"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell |
154 | 156 |
155 syn region csBracketed matchgroup=csParens start=+(+ end=+)+ contained transparent contains=@csAll,csBracketed | 157 syn region csBracketed matchgroup=csParens start=+(+ end=+)+ extend contained transparent contains=@csAll,csBraced,csBracketed |
156 | 158 syn region csBraced matchgroup=csParens start=+{+ end=+}+ extend contained transparent contains=@csAll,csBraced,csBracketed |
157 syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStatement,csEndColon,csInterpolatedString,csIsType,csLabel,csLogicSymbols,csNewType,csConstant,csNumber,csOpSymbols,csOperatorError,csParens,csPreCondit,csRegion,csString,csSummary,csType,csUnicodeNumber,csUnicodeSpecifier,csVerbatimString,csUserType,csUserIdentifier,csUserInterface,csUserMethod | 159 |
160 syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStatement,csEndColon,csIsType,csLabel,csLogicSymbols,csNewType,csConstant,csNumber,csOpSymbols,csOperatorError,csParens,csPreCondit,csRegion,csString,csSummary,csType,csUnicodeNumber,csUnicodeSpecifier,csInterpolatedString,csVerbatimString,csInterVerbString,csUserType,csUserIdentifier,csUserInterface,csUserMethod | |
158 | 161 |
159 " The default highlighting. | 162 " The default highlighting. |
160 hi def link csType Type | 163 hi def link csType Type |
161 hi def link csClassType Type | 164 hi def link csClassType Type |
162 hi def link csIsType Type | 165 hi def link csIsType Type |