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