annotate runtime/syntax/cs.vim @ 478:87ac4be38952 v7.0128

updated for version 7.0128
author vimboss
date Thu, 11 Aug 2005 20:11:38 +0000
parents 4707450c2b33
children 9f279ebda751
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#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Johannes Zellner <johannes@zellner.org>
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
4 " Last Change: Mi, 13 Apr 2005 22:52:57 CEST
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Filenames: *.cs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " $Id$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " REFERENCES:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let s:cs_cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 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
21 " storage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword csStorage class delegate enum interface namespace struct
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " repeate / condition / label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword csRepeat break continue do for foreach goto return while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword csConditional else if switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword csLabel case default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " there's no :: operator in C#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match csOperatorError display +::+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " user labels (see [1] 8.6 Statements)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " modifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 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
33 " constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword csConstant false null true
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword csException try catch finally throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 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
40 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword csUnsupportedStatement get set add remove value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword csUnspecifiedKeyword explicit implicit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " PROVIDES: @csCommentHook
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " TODO: include strings ?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword csTodo contained TODO FIXME XXX NOTE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match csComment "//.*$" contains=@csCommentHook,csTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " xml markup inside '///' comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn cluster xmlRegionHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn cluster xmlCdataHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn cluster xmlStartTagHook add=csXmlCommentLeader
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 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
70 syn keyword csXmlTag contained list listheader item term description altcompliant altmember
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn cluster xmlTagHook add=csXmlTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match csXmlCommentLeader +\/\/\/+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syntax include @csXml <sfile>:p:h/xml.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 hi def link xmlRegion Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " [1] 9.5 Pre-processing directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn region csPreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\|region\|endregion\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 \ skip="\\$" end="$" contains=csComment keepend
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " Strings and constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match csSpecialError contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match csSpecialCharError contained "[^']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 " [1] 9.4.4.4 Character literals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match csSpecialChar contained +\\["\\'0abfnrtvx]+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 " unicode characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match csUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=csUnicodeSpecifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match csUnicodeSpecifier +\\[uU]+ contained
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
95 syn region csVerbatimString start=+@"+ end=+"+ end=+$+ skip=+""+ contains=csVerbatimSpec
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match csVerbatimSpec +@"+he=s+1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn region csString start=+"+ end=+"+ end=+$+ contains=csSpecialChar,csSpecialError,csUnicodeNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match csCharacter "'\\''" contains=csSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match csCharacter "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match csNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn match csNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match csNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 hi def link csType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 hi def link csStorage StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 hi def link csRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 hi def link csConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 hi def link csLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 hi def link csModifier StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 hi def link csConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 hi def link csException Exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 hi def link csUnspecifiedStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 hi def link csUnsupportedStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 hi def link csUnspecifiedKeyword Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 hi def link csOperatorError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 hi def link csTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 hi def link csComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 hi def link csSpecialError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 hi def link csSpecialCharError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 hi def link csString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 hi def link csVerbatimString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 hi def link csVerbatimSpec SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 hi def link csPreCondit PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 hi def link csCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 hi def link csSpecialChar SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 hi def link csNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 hi def link csUnicodeNumber SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 hi def link csUnicodeSpecifier SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " xml markup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 hi def link csXmlCommentLeader Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 hi def link csXmlComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 hi def link csXmlTag Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 let b:current_syntax = "cs"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 let &cpo = s:cs_cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 unlet s:cs_cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 " vim: ts=8