annotate runtime/syntax/cs.vim @ 13453:5dab288bada8

Added tag v8.0.1600 for changeset 9b09f6e470e05362469f8b981bd7a8c7c2608ab6
author Christian Brabandt <cb@256bit.org>
date Mon, 12 Mar 2018 22:00:07 +0100
parents 7bc41231fbc7
children e751b5c9dff3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: C#
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
3 " Maintainer: Anduin Withers <awithers@anduin.com>
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
4 " Former Maintainer: Johannes Zellner <johannes@zellner.org>
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 859
diff changeset
5 " Last Change: Fri Aug 14 13:56:37 PDT 2009
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Filenames: *.cs
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 859
diff changeset
7 " $Id: cs.vim,v 1.4 2006/05/03 21:20:02 vimboss Exp $
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " REFERENCES:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 let s:cs_cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword csType bool byte char decimal double float int long object sbyte short string uint ulong ushort void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " storage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword csStorage class delegate enum interface namespace struct
843
9f279ebda751 updated for version 7.0f01
vimboss
parents: 236
diff changeset
24 " repeat / condition / label
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword csRepeat break continue do for foreach goto return while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword csConditional else if switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword csLabel case default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " there's no :: operator in C#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match csOperatorError display +::+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " user labels (see [1] 8.6 Statements)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " modifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword csConstant false null true
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword csException try catch finally throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword csUnspecifiedStatement as base checked event fixed in is lock new operator out params ref sizeof stackalloc this typeof unchecked unsafe using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " TODO:
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
42 syn keyword csUnsupportedStatement add remove value
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword csUnspecifiedKeyword explicit implicit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
47 " Contextual Keywords
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
48 syn match csContextualStatement /\<yield[[:space:]\n]\+\(return\|break\)/me=s+5
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
49 syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interface\)/me=s+7
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
50 syn match csContextualStatement /\<\(get\|set\)[[:space:]\n]*{/me=s+3
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
51 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " PROVIDES: @csCommentHook
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " TODO: include strings ?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword csTodo contained TODO FIXME XXX NOTE
843
9f279ebda751 updated for version 7.0f01
vimboss
parents: 236
diff changeset
60 syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo,@Spell
9f279ebda751 updated for version 7.0f01
vimboss
parents: 236
diff changeset
61 syn match csComment "//.*$" contains=@csCommentHook,csTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " xml markup inside '///' comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn cluster xmlRegionHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn cluster xmlCdataHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn cluster xmlStartTagHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword csXmlTag contained list listheader item term description altcompliant altmember
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn cluster xmlTagHook add=csXmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn match csXmlCommentLeader +\/\/\/+ contained
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 859
diff changeset
81 syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml,@Spell
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 859
diff changeset
82 syntax include @csXml syntax/xml.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 hi def link xmlRegion Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " [1] 9.5 Pre-processing directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region csPreCondit
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
88 \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 \ skip="\\$" end="$" contains=csComment keepend
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
90 syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$"
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
91 \ end="^\s*#\s*endregion" transparent fold contains=TOP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " Strings and constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match csSpecialError contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn match csSpecialCharError contained "[^']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " [1] 9.4.4.4 Character literals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match csSpecialChar contained +\\["\\'0abfnrtvx]+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " unicode characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match csUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=csUnicodeSpecifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn match csUnicodeSpecifier +\\[uU]+ contained
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 859
diff changeset
103 syn region csVerbatimString start=+@"+ end=+"+ skip=+""+ contains=csVerbatimSpec,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match csVerbatimSpec +@"+he=s+1 contained
843
9f279ebda751 updated for version 7.0f01
vimboss
parents: 236
diff changeset
105 syn region csString start=+"+ end=+"+ end=+$+ contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn match csCharacter "'\\''" contains=csSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn match csCharacter "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn match csNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn match csNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match csNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 hi def link csType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 hi def link csStorage StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 hi def link csRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 hi def link csConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 hi def link csLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 hi def link csModifier StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 hi def link csConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 hi def link csException Exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 hi def link csUnspecifiedStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 hi def link csUnsupportedStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 hi def link csUnspecifiedKeyword Keyword
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 843
diff changeset
126 hi def link csContextualStatement Statement
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 hi def link csOperatorError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 hi def link csTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 hi def link csComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 hi def link csSpecialError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 hi def link csSpecialCharError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 hi def link csString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 hi def link csVerbatimString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 hi def link csVerbatimSpec SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 hi def link csPreCondit PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 hi def link csCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 hi def link csSpecialChar SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 hi def link csNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 hi def link csUnicodeNumber SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 hi def link csUnicodeSpecifier SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 " xml markup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 hi def link csXmlCommentLeader Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 hi def link csXmlComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 hi def link csXmlTag Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 let b:current_syntax = "cs"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 let &cpo = s:cs_cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 unlet s:cs_cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 " vim: ts=8