Mercurial > vim
comparison runtime/syntax/cs.vim @ 14372:2a4a2dc35c55
Update runtime files.
commit https://github.com/vim/vim/commit/a9604e61451707b38fdcb088fbfaeea2b922fef6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 21 05:56:22 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Jul 2018 06:00:09 +0200 |
parents | e751b5c9dff3 |
children | bc1a8d21c811 |
comparison
equal
deleted
inserted
replaced
14371:2fb503a18f12 | 14372:2a4a2dc35c55 |
---|---|
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 Maintainer: Anduin Withers <awithers@anduin.com> | 4 " Former Maintainers: Anduin Withers <awithers@anduin.com> |
5 " Former Maintainer: Johannes Zellner <johannes@zellner.org> | 5 " Johannes Zellner <johannes@zellner.org> |
6 " Last Change: 2018-05-02 | 6 " Last Change: 2018-06-29 |
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: |
12 " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) | 12 " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) |
13 | 13 |
14 if exists("b:current_syntax") | 14 if exists("b:current_syntax") |
17 | 17 |
18 let s:cs_cpo_save = &cpo | 18 let s:cs_cpo_save = &cpo |
19 set cpo&vim | 19 set cpo&vim |
20 | 20 |
21 | 21 |
22 syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic | 22 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 | 23 syn keyword csStorage delegate enum interface namespace struct |
24 syn keyword csRepeat break continue do for foreach goto return while | 24 syn keyword csRepeat break continue do for foreach goto return while |
25 syn keyword csConditional else if switch | 25 syn keyword csConditional else if switch |
26 syn keyword csLabel case default | 26 syn keyword csLabel case default |
27 " there's no :: operator in C# | 27 syn match csOperatorError display +::+ |
28 syn match csOperatorError display +::+ | 28 syn match csGlobal display +global::+ |
29 " user labels (see [1] 8.6 Statements) | 29 " user labels (see [1] 8.6 Statements) |
30 syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+ | 30 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 | 31 syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile |
32 syn keyword csConstant false null true | 32 syn keyword csConstant false null true |
33 syn keyword csException try catch finally throw when | 33 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 | 34 syn keyword csLinq ascending by descending equals from group in into join let on orderby select where |
35 syn keyword csAsync async await | 35 syn keyword csAsync async await |
36 | 36 |
37 syn keyword csUnspecifiedStatement as base checked event fixed get in is lock nameof operator out params ref set sizeof stackalloc this typeof unchecked unsafe using | 37 syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this typeof unchecked unsafe using |
38 syn keyword csUnsupportedStatement add remove value | 38 syn keyword csUnsupportedStatement add remove value |
39 syn keyword csUnspecifiedKeyword explicit implicit | 39 syn keyword csUnspecifiedKeyword explicit implicit |
40 | 40 |
41 " Contextual Keywords | 41 " Contextual Keywords |
42 syn match csContextualStatement /\<yield[[:space:]\n]\+\(return\|break\)/me=s+5 | 42 syn match csContextualStatement /\<yield[[:space:]\n]\+\(return\|break\)/me=s+5 |
43 syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7 | 43 syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7 |
44 syn match csContextualStatement /\<\(get\|set\)[[:space:]\n]*{/me=s+3 | 44 syn match csContextualStatement /\<\(get\|set\)\(;\|[[:space:]\n]*{\)/me=s+3 |
45 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5 | 45 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5 |
46 | |
47 " Punctuation | |
48 syn match csBraces "[{}\[\]]" display | |
49 syn match csParens "[()]" display | |
50 syn match csOpSymbols "[+\-><=]\{1,2}" display | |
51 syn match csOpSymbols "[!><+\-*/]=" display | |
52 syn match csOpSymbols "[!*/^]" display | |
53 syn match csOpSymbols "=>" display | |
54 syn match csEndColon ";" display | |
55 syn match csLogicSymbols "&&" display | |
56 syn match csLogicSymbols "||" display | |
57 syn match csLogicSymbols "?" display | |
58 syn match csLogicSymbols ":" display | |
46 | 59 |
47 " Comments | 60 " Comments |
48 " | 61 " |
49 " PROVIDES: @csCommentHook | 62 " PROVIDES: @csCommentHook |
50 " | 63 syn keyword csTodo contained TODO FIXME XXX NOTE HACK TBD |
51 " TODO: include strings ? | 64 syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo,@Spell |
52 " | 65 syn match csComment "//.*$" contains=@csCommentHook,csTodo,@Spell |
53 syn keyword csTodo contained TODO FIXME XXX NOTE HACK | |
54 syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo,@Spell | |
55 syn match csComment "//.*$" contains=@csCommentHook,csTodo,@Spell | |
56 | 66 |
57 " xml markup inside '///' comments | 67 " xml markup inside '///' comments |
58 syn cluster xmlRegionHook add=csXmlCommentLeader | 68 syn cluster xmlRegionHook add=csXmlCommentLeader |
59 syn cluster xmlCdataHook add=csXmlCommentLeader | 69 syn cluster xmlCdataHook add=csXmlCommentLeader |
60 syn cluster xmlStartTagHook add=csXmlCommentLeader | 70 syn cluster xmlStartTagHook add=csXmlCommentLeader |
61 syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName | 71 syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName |
62 syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo | 72 syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo |
63 syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base | 73 syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base |
64 syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute | 74 syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute |
65 syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue | 75 syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue |
66 syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage | 76 syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage |
67 syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary | 77 syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary |
68 syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote | 78 syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote |
69 syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript | 79 syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript |
70 syn keyword csXmlTag contained list listheader item term description altcompliant altmember | 80 syn keyword csXmlTag contained list listheader item term description altcompliant altmember |
71 | 81 |
72 syn cluster xmlTagHook add=csXmlTag | 82 syn cluster xmlTagHook add=csXmlTag |
73 | 83 |
74 syn match csXmlCommentLeader +\/\/\/+ contained | 84 syn match csXmlCommentLeader +\/\/\/+ contained |
75 syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml,@Spell | 85 syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml,@Spell |
76 syntax include @csXml syntax/xml.vim | 86 syn include @csXml syntax/xml.vim |
77 hi def link xmlRegion Comment | 87 hi def link xmlRegion Comment |
78 | 88 |
79 | 89 |
80 " [1] 9.5 Pre-processing directives | 90 " [1] 9.5 Pre-processing directives |
81 syn region csPreCondit | 91 syn region csPreCondit start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)" skip="\\$" end="$" contains=csComment keepend |
82 \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)" | 92 syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" end="^\s*#\s*endregion" transparent fold contains=TOP |
83 \ skip="\\$" end="$" contains=csComment keepend | 93 syn region csSummary start="^\s*/// <summary" end="^\%\(\s*///\)\@!" transparent fold keepend |
84 syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" | 94 |
85 \ end="^\s*#\s*endregion" transparent fold contains=TOP | 95 |
86 syn region csSummary start="^\s*/// <summary" end="^\(\s*///\)\@!" transparent fold keepend | 96 syn region csClassType start="@\@1<!\<class\>"hs=s+6 end="[:\n{]"me=e-1 contains=csClass |
87 | 97 syn region csNewType start="@\@1<!\<new\>"hs=s+4 end="[;\n{(<\[]"me=e-1 contains=csNew contains=csNewType |
88 | 98 syn region csIsType start=" is "hs=s+4 end="[A-Za-z0-9]\+" oneline contains=csIsAs |
89 syn region csClassType start="\(@\)\@<!class\>"hs=s+6 end="[:\n{]"he=e-1 contains=csClass | 99 syn region csIsType start=" as "hs=s+4 end="[A-Za-z0-9]\+" oneline contains=csIsAs |
90 syn region csNewType start="\(@\)\@<!new\>"hs=s+4 end="[\(\<{\[]"he=e-1 contains=csNew contains=csNewType | 100 syn keyword csNew new contained |
91 syn region csIsType start="\v (is|as) "hs=s+4 end="\v[A-Za-z0-9]+" oneline contains=csIsAs | 101 syn keyword csClass class contained |
92 syn keyword csNew new contained | 102 syn keyword csIsAs is as |
93 syn keyword csClass class contained | |
94 syn keyword csIsAs is as | |
95 | 103 |
96 " Strings and constants | 104 " Strings and constants |
97 syn match csSpecialError contained "\\." | 105 syn match csSpecialError "\\." contained |
98 syn match csSpecialCharError contained "[^']" | 106 syn match csSpecialCharError "[^']" contained |
99 " [1] 9.4.4.4 Character literals | 107 " [1] 9.4.4.4 Character literals |
100 syn match csSpecialChar contained +\\["\\'0abfnrtvx]+ | 108 syn match csSpecialChar +\\["\\'0abfnrtvx]+ contained display |
101 " unicode characters | 109 syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier display |
102 syn match csUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=csUnicodeSpecifier | 110 syn match csUnicodeNumber +\\U\x\{8}+ contained contains=csUnicodeSpecifier display |
103 syn match csUnicodeSpecifier +\\[uU]+ contained | 111 syn match csUnicodeSpecifier +\\[uU]+ contained display |
104 syn region csVerbatimString start=+@"+ end=+"+ skip=+""+ contains=csVerbatimSpec,@Spell | 112 |
105 syn match csVerbatimSpec +@"+he=s+1 contained | 113 syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell |
106 syn region csString start=+"+ end=+"+ end=+$+ contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell | 114 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError display |
107 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError | 115 syn match csCharacter "'\\''" contains=csSpecialChar display |
108 syn match csCharacter "'\\''" contains=csSpecialChar | 116 syn match csCharacter "'[^\\]'" display |
109 syn match csCharacter "'[^\\]'" | 117 syn match csNumber "\<0[0-7]*[lL]\=\>" display |
110 syn match csNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" | 118 syn match csNumber "\<0[xX]\x\+[lL]\=\>" display |
111 syn match csNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" | 119 syn match csNumber "\<\d\+[lL]\=\>" display |
112 syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" | 120 syn match csNumber "\<\d\+\.\d*\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display |
113 syn match csNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" | 121 syn match csNumber "\.\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display |
122 syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" display | |
123 syn match csNumber "\<\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\>" display | |
124 | |
125 syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ end=+$+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell | |
126 | |
127 syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBracketed,csInterpolationAlign,csInterpolationFormat | |
128 syn match csEscapedInterpolation "{{" transparent contains=NONE display | |
129 syn match csEscapedInterpolation "}}" transparent contains=NONE display | |
130 syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=csNumber,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display | |
131 syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFormatDel display | |
132 syn match csInterpolationAlignDel +,+ contained display | |
133 syn match csInterpolationFormatDel +:+ contained display | |
134 | |
135 syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"+ skip=+""+ extend contains=csVerbatimQuote,@Spell | |
136 syn match csVerbatimQuote +""+ contained | |
137 syn match csQuoteError +@$"+he=s+2,me=s+2 | |
138 | |
139 syn region csInterVerbString matchgroup=csQuote start=+\$@"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell | |
140 | |
141 syn region csBracketed matchgroup=csParens start=+(+ end=+)+ contained transparent contains=@csAll,csBracketed | |
142 | |
143 syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStatement,csEndColon,csInterpolatedString,csIsType,csLabel,csLogicSymbols,csNewType,csConstant,csNumber,csOpSymbols,csOperatorError,csParens,csPreCondit,csRegion,csString,csSummary,csUnicodeNumber,csUnicodeSpecifier,csVerbatimString | |
114 | 144 |
115 " The default highlighting. | 145 " The default highlighting. |
116 hi def link csType Type | 146 hi def link csType Type |
117 hi def link csNewType Type | 147 hi def link csNewType Type |
118 hi def link csClassType Type | 148 hi def link csClassType Type |
119 hi def link csIsType Type | 149 hi def link csIsType Type |
120 hi def link csStorage StorageClass | 150 hi def link csStorage StorageClass |
121 hi def link csClass StorageClass | 151 hi def link csClass StorageClass |
122 hi def link csRepeat Repeat | 152 hi def link csRepeat Repeat |
123 hi def link csConditional Conditional | 153 hi def link csConditional Conditional |
124 hi def link csLabel Label | 154 hi def link csLabel Label |
125 hi def link csModifier StorageClass | 155 hi def link csModifier StorageClass |
126 hi def link csConstant Constant | 156 hi def link csConstant Constant |
127 hi def link csException Exception | 157 hi def link csException Exception |
128 hi def link csUnspecifiedStatement Statement | 158 hi def link csUnspecifiedStatement Statement |
129 hi def link csUnsupportedStatement Statement | 159 hi def link csUnsupportedStatement Statement |
130 hi def link csUnspecifiedKeyword Keyword | 160 hi def link csUnspecifiedKeyword Keyword |
131 hi def link csNew Statement | 161 hi def link csNew Statement |
132 hi def link csLinq Statement | 162 hi def link csLinq Statement |
133 hi def link csIsAs Keyword | 163 hi def link csIsAs Keyword |
134 hi def link csAsync Keyword | 164 hi def link csAsync Keyword |
135 hi def link csContextualStatement Statement | 165 hi def link csContextualStatement Statement |
136 hi def link csOperatorError Error | 166 hi def link csOperatorError Error |
137 hi def link csInterfaceDeclaration Include | 167 hi def link csInterfaceDeclaration Include |
138 | 168 |
139 hi def link csTodo Todo | 169 hi def link csTodo Todo |
140 hi def link csComment Comment | 170 hi def link csComment Comment |
141 | 171 |
142 hi def link csSpecialError Error | 172 hi def link csEndColon Statement |
143 hi def link csSpecialCharError Error | 173 hi def link csOpSymbols Operator |
144 hi def link csString String | 174 hi def link csLogicSymbols Boolean |
145 hi def link csVerbatimString String | 175 hi def link csBraces Function |
146 hi def link csVerbatimSpec SpecialChar | 176 hi def link csParens Operator |
147 hi def link csPreCondit PreCondit | 177 |
148 hi def link csCharacter Character | 178 hi def link csSpecialError Error |
149 hi def link csSpecialChar SpecialChar | 179 hi def link csSpecialCharError Error |
150 hi def link csNumber Number | 180 hi def link csString String |
151 hi def link csUnicodeNumber SpecialChar | 181 hi def link csQuote String |
152 hi def link csUnicodeSpecifier SpecialChar | 182 hi def link csQuoteError Error |
183 hi def link csInterpolatedString String | |
184 hi def link csVerbatimString String | |
185 hi def link csInterVerbString String | |
186 hi def link csVerbatimQuote SpecialChar | |
187 hi def link csPreCondit PreCondit | |
188 hi def link csCharacter Character | |
189 hi def link csSpecialChar SpecialChar | |
190 hi def link csNumber Number | |
191 hi def link csUnicodeNumber SpecialChar | |
192 hi def link csUnicodeSpecifier SpecialChar | |
193 hi def link csInterpolationDelimiter Delimiter | |
194 hi def link csInterpolationAlignDel csInterpolationDelimiter | |
195 hi def link csInterpolationFormat csInterpolationDelimiter | |
196 hi def link csInterpolationFormatDel csInterpolationDelimiter | |
153 | 197 |
154 " xml markup | 198 " xml markup |
155 hi def link csXmlCommentLeader Comment | 199 hi def link csXmlCommentLeader Comment |
156 hi def link csXmlComment Comment | 200 hi def link csXmlComment Comment |
157 hi def link csXmlTag Statement | 201 hi def link csXmlTag Statement |
158 | 202 |
159 let b:current_syntax = "cs" | 203 let b:current_syntax = "cs" |
160 | 204 |
161 let &cpo = s:cs_cpo_save | 205 let &cpo = s:cs_cpo_save |
162 unlet s:cs_cpo_save | 206 unlet s:cs_cpo_save |
163 | 207 |
164 " vim: ts=8 | 208 " vim: vts=16,28 |