annotate runtime/syntax/uc.vim @ 1047:2d0f22897a4d v7.0.173

updated for version 7.0-173
author vimboss
date Tue, 28 Nov 2006 19:54:04 +0000
parents 3fc0f57ecb91
children 43efa4f5a8ea
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: UnrealScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Mark Ferrell <major@chaoticdreams.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: ftp://ftp.chaoticdreams.org/pub/ut/vim/uc.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Credits: Based on the java.vim syntax file by Claudio Fleiner
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Last change: 2003 May 31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Please check :help uc.vim for comments on some of the options available.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " some characters that cannot be in a UnrealScript program (outside a string)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match ucError "[\\@`]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn match ucError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " we define it here so that included files can test for it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 let main_syntax='uc'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syntax case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " keyword definitions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword ucBranch break continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword ucConditional if else switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword ucRepeat while for do foreach
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword ucBoolean true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword ucConstant null
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword ucOperator new instanceof
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword ucType boolean char byte short int long float double
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword ucType void Pawn sound state auto exec function ipaddr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword ucType ELightType actor ammo defaultproperties bool
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword ucType native noexport var out vector name local string
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword ucType event
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword ucStatement return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword ucStorageClass static synchronized transient volatile final
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword ucMethodDecl synchronized throws
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " UnrealScript defines classes in sorta fscked up fashion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match ucClassDecl "^[Cc]lass[\s$]*\S*[\s$]*expands[\s$]*\S*;" contains=ucSpecial,ucSpecialChar,ucClassKeys
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword ucClassKeys class expands extends
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match ucExternal "^\#exec.*" contains=ucCommentString,ucNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword ucScopeDecl public protected private abstract
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " UnrealScript Functions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match ucFuncDef "^.*function\s*[\(]*" contains=ucType,ucStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match ucEventDef "^.*event\s*[\(]*" contains=ucType,ucStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match ucClassLabel "[a-zA-Z0-9]*\'[a-zA-Z0-9]*\'" contains=ucCharacter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn region ucLabelRegion transparent matchgroup=ucLabel start="\<case\>" matchgroup=NONE end=":" contains=ucNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match ucUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=ucLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword ucLabel default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " The following cluster contains all java groups except the contained ones
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn cluster ucTop contains=ucExternal,ucError,ucError,ucBranch,ucLabelRegion,ucLabel,ucConditional,ucRepeat,ucBoolean,ucConstant,ucTypedef,ucOperator,ucType,ucType,ucStatement,ucStorageClass,ucMethodDecl,ucClassDecl,ucClassDecl,ucClassDecl,ucScopeDecl,ucError,ucError2,ucUserLabel,ucClassLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword ucTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn region ucCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=ucSpecial,ucCommentStar,ucSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn region ucComment2String contained start=+"+ end=+$\|"+ contains=ucSpecial,ucSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match ucCommentCharacter contained "'\\[^']\{1,6\}'" contains=ucSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn match ucCommentCharacter contained "'\\''" contains=ucSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match ucCommentCharacter contained "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn region ucComment start="/\*" end="\*/" contains=ucCommentString,ucCommentCharacter,ucNumber,ucTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match ucCommentStar contained "^\s*\*[^/]"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match ucCommentStar contained "^\s*\*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match ucLineComment "//.*" contains=ucComment2String,ucCommentCharacter,ucNumber,ucTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 hi link ucCommentString ucString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 hi link ucComment2String ucString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 hi link ucCommentCharacter ucCharacter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn cluster ucTop add=ucComment,ucLineComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " match the special comment /**/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn match ucComment "/\*\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " Strings and constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match ucSpecialError contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 "syn match ucSpecialCharError contained "[^']"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn match ucSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region ucString start=+"+ end=+"+ contains=ucSpecialChar,ucSpecialError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match ucStringError +"\([^"\\]\|\\.\)*$+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match ucCharacter "'[^']*'" contains=ucSpecialChar,ucSpecialCharError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match ucCharacter "'\\''" contains=ucSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match ucCharacter "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match ucNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match ucNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match ucNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match ucNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 " unicode characters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match ucSpecial "\\u\d\{4\}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn cluster ucTop add=ucString,ucCharacter,ucNumber,ucSpecial,ucStringError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " catch errors caused by wrong parenthesis
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn region ucParen transparent start="(" end=")" contains=@ucTop,ucParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match ucParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 hi link ucParenError ucError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 if !exists("uc_minlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 let uc_minlines = 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 exec "syn sync ccomment ucComment minlines=" . uc_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 if version >= 508 || !exists("did_uc_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 let did_uc_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink ucFuncDef Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink ucEventDef Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink ucBraces Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink ucBranch Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink ucLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 HiLink ucUserLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink ucConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 HiLink ucRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 HiLink ucStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 HiLink ucMethodDecl ucStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 HiLink ucClassDecl ucStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 HiLink ucScopeDecl ucStorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 HiLink ucBoolean Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 HiLink ucSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 HiLink ucSpecialError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 HiLink ucSpecialCharError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 HiLink ucString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 HiLink ucCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 HiLink ucSpecialChar SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 HiLink ucNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 HiLink ucError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 HiLink ucStringError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 HiLink ucStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 HiLink ucOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 HiLink ucOverLoaded Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 HiLink ucComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 HiLink ucDocComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 HiLink ucLineComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 HiLink ucConstant ucBoolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 HiLink ucTypedef Typedef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 HiLink ucTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 HiLink ucCommentTitle SpecialComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 HiLink ucDocTags Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 HiLink ucDocParam Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 HiLink ucCommentStar ucComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 HiLink ucType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 HiLink ucExternal Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 HiLink ucClassKeys Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 HiLink ucClassLabel Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 HiLink htmlComment Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 HiLink htmlCommentPart Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 let b:current_syntax = "uc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 if main_syntax == 'uc'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 " vim: ts=8