Mercurial > vim
annotate runtime/syntax/groovy.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | bc38030aec7d |
children | 46763b01cd9a |
rev | line source |
---|---|
799 | 1 " Vim syntax file |
2 " Language: Groovy | |
2662 | 3 " Original Author: Alessio Pace <billy.corgan@tiscali.it> |
4 " Maintainer: Tobias Rapp <yahuxo@gmx.de> | |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
5 " Version: 0.1.16 |
3281 | 6 " URL: http://www.vim.org/scripts/script.php?script_id=945 |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
7 " Last Change: 2016 May 23 |
799 | 8 |
2662 | 9 " THE ORIGINAL AUTHOR'S NOTES: |
10 " | |
799 | 11 " This is my very first vim script, I hope to have |
12 " done it the right way. | |
3281 | 13 " |
799 | 14 " I must directly or indirectly thank the author of java.vim and ruby.vim: |
15 " I copied from them most of the stuff :-) | |
16 " | |
17 " Relies on html.vim | |
18 | |
19 " For version 5.x: Clear all syntax items | |
20 " For version 6.x: Quit when a syntax file was already loaded | |
21 " | |
2662 | 22 " HOWTO USE IT (INSTALL) when not part of the distribution: |
799 | 23 " |
24 " 1) copy the file in the (global or user's $HOME/.vim/syntax/) syntax folder | |
3281 | 25 " |
799 | 26 " 2) add this line to recognize groovy files by filename extension: |
27 " | |
28 " au BufNewFile,BufRead *.groovy setf groovy | |
29 " in the global vim filetype.vim file or inside $HOME/.vim/filetype.vim | |
30 " | |
31 " 3) add this part to recognize by content groovy script (no extension needed :-) | |
32 " | |
33 " if did_filetype() | |
34 " finish | |
35 " endif | |
36 " if getline(1) =~ '^#!.*[/\\]groovy\>' | |
37 " setf groovy | |
38 " endif | |
39 " | |
40 " in the global scripts.vim file or in $HOME/.vim/scripts.vim | |
3281 | 41 " |
799 | 42 " 4) open/write a .groovy file or a groovy script :-) |
43 " | |
44 " Let me know if you like it or send me patches, so that I can improve it | |
45 " when I have time | |
46 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
47 " quit when a syntax file was already loaded |
799 | 48 if !exists("main_syntax") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
49 if exists("b:current_syntax") |
799 | 50 finish |
51 endif | |
52 " we define it here so that included files can test for it | |
53 let main_syntax='groovy' | |
54 endif | |
55 | |
3281 | 56 let s:cpo_save = &cpo |
57 set cpo&vim | |
58 | |
799 | 59 " don't use standard HiLink, it will not work with included syntax files |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
60 command! -nargs=+ GroovyHiLink hi def link <args> |
799 | 61 |
62 " ########################## | |
63 " Java stuff taken from java.vim | |
64 " some characters that cannot be in a groovy program (outside a string) | |
65 " syn match groovyError "[\\@`]" | |
66 "syn match groovyError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/" | |
67 "syn match groovyOK "\.\.\." | |
68 | |
69 " keyword definitions | |
70 syn keyword groovyExternal native package | |
4339 | 71 syn match groovyExternal "\<import\>\(\s\+static\>\)\?" |
799 | 72 syn keyword groovyError goto const |
73 syn keyword groovyConditional if else switch | |
74 syn keyword groovyRepeat while for do | |
75 syn keyword groovyBoolean true false | |
76 syn keyword groovyConstant null | |
77 syn keyword groovyTypedef this super | |
78 syn keyword groovyOperator new instanceof | |
79 syn keyword groovyType boolean char byte short int long float double | |
80 syn keyword groovyType void | |
81 syn keyword groovyType Integer Double Date Boolean Float String Array Vector List | |
82 syn keyword groovyStatement return | |
83 syn keyword groovyStorageClass static synchronized transient volatile final strictfp serializable | |
84 syn keyword groovyExceptions throw try catch finally | |
85 syn keyword groovyAssert assert | |
86 syn keyword groovyMethodDecl synchronized throws | |
87 syn keyword groovyClassDecl extends implements interface | |
88 " to differentiate the keyword class from MyClass.class we use a match here | |
89 syn match groovyTypedef "\.\s*\<class\>"ms=s+1 | |
90 syn keyword groovyClassDecl enum | |
91 syn match groovyClassDecl "^class\>" | |
92 syn match groovyClassDecl "[^.]\s*\<class\>"ms=s+1 | |
93 syn keyword groovyBranch break continue nextgroup=groovyUserLabelRef skipwhite | |
94 syn match groovyUserLabelRef "\k\+" contained | |
95 syn keyword groovyScopeDecl public protected private abstract | |
96 | |
97 | |
98 if exists("groovy_highlight_groovy_lang_ids") || exists("groovy_highlight_groovy_lang") || exists("groovy_highlight_all") | |
99 " groovy.lang.* | |
100 syn keyword groovyLangClass Closure MetaMethod GroovyObject | |
3281 | 101 |
799 | 102 syn match groovyJavaLangClass "\<System\>" |
103 syn keyword groovyJavaLangClass Cloneable Comparable Runnable Serializable Boolean Byte Class Object | |
104 syn keyword groovyJavaLangClass Character CharSequence ClassLoader Compiler | |
3281 | 105 " syn keyword groovyJavaLangClass Integer Double Float Long |
799 | 106 syn keyword groovyJavaLangClass InheritableThreadLocal Math Number Object Package Process |
107 syn keyword groovyJavaLangClass Runtime RuntimePermission InheritableThreadLocal | |
108 syn keyword groovyJavaLangClass SecurityManager Short StrictMath StackTraceElement | |
109 syn keyword groovyJavaLangClass StringBuffer Thread ThreadGroup | |
110 syn keyword groovyJavaLangClass ThreadLocal Throwable Void ArithmeticException | |
111 syn keyword groovyJavaLangClass ArrayIndexOutOfBoundsException AssertionError | |
112 syn keyword groovyJavaLangClass ArrayStoreException ClassCastException | |
113 syn keyword groovyJavaLangClass ClassNotFoundException | |
114 syn keyword groovyJavaLangClass CloneNotSupportedException Exception | |
115 syn keyword groovyJavaLangClass IllegalAccessException | |
116 syn keyword groovyJavaLangClass IllegalArgumentException | |
117 syn keyword groovyJavaLangClass IllegalMonitorStateException | |
118 syn keyword groovyJavaLangClass IllegalStateException | |
119 syn keyword groovyJavaLangClass IllegalThreadStateException | |
120 syn keyword groovyJavaLangClass IndexOutOfBoundsException | |
121 syn keyword groovyJavaLangClass InstantiationException InterruptedException | |
122 syn keyword groovyJavaLangClass NegativeArraySizeException NoSuchFieldException | |
123 syn keyword groovyJavaLangClass NoSuchMethodException NullPointerException | |
124 syn keyword groovyJavaLangClass NumberFormatException RuntimeException | |
125 syn keyword groovyJavaLangClass SecurityException StringIndexOutOfBoundsException | |
126 syn keyword groovyJavaLangClass UnsupportedOperationException | |
127 syn keyword groovyJavaLangClass AbstractMethodError ClassCircularityError | |
128 syn keyword groovyJavaLangClass ClassFormatError Error ExceptionInInitializerError | |
129 syn keyword groovyJavaLangClass IllegalAccessError InstantiationError | |
130 syn keyword groovyJavaLangClass IncompatibleClassChangeError InternalError | |
131 syn keyword groovyJavaLangClass LinkageError NoClassDefFoundError | |
132 syn keyword groovyJavaLangClass NoSuchFieldError NoSuchMethodError | |
133 syn keyword groovyJavaLangClass OutOfMemoryError StackOverflowError | |
134 syn keyword groovyJavaLangClass ThreadDeath UnknownError UnsatisfiedLinkError | |
135 syn keyword groovyJavaLangClass UnsupportedClassVersionError VerifyError | |
136 syn keyword groovyJavaLangClass VirtualMachineError | |
137 | |
138 syn keyword groovyJavaLangObject clone equals finalize getClass hashCode | |
139 syn keyword groovyJavaLangObject notify notifyAll toString wait | |
140 | |
141 GroovyHiLink groovyLangClass groovyConstant | |
142 GroovyHiLink groovyJavaLangClass groovyExternal | |
143 GroovyHiLink groovyJavaLangObject groovyConstant | |
144 syn cluster groovyTop add=groovyJavaLangObject,groovyJavaLangClass,groovyLangClass | |
145 syn cluster groovyClasses add=groovyJavaLangClass,groovyLangClass | |
146 endif | |
147 | |
148 | |
149 " Groovy stuff | |
150 syn match groovyOperator "\.\." | |
151 syn match groovyOperator "<\{2,3}" | |
152 syn match groovyOperator ">\{2,3}" | |
153 syn match groovyOperator "->" | |
6823 | 154 syn match groovyLineComment '^\%1l#!.*' " Shebang line |
799 | 155 syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>" |
156 | |
157 " Groovy JDK stuff | |
158 syn keyword groovyJDKBuiltin as def in | |
3281 | 159 syn keyword groovyJDKOperOverl div minus plus abs round power multiply |
160 syn keyword groovyJDKMethods each call inject sort print println | |
799 | 161 syn keyword groovyJDKMethods getAt putAt size push pop toList getText writeLine eachLine readLines |
3281 | 162 syn keyword groovyJDKMethods withReader withStream withWriter withPrintWriter write read leftShift |
799 | 163 syn keyword groovyJDKMethods withWriterAppend readBytes splitEachLine |
3281 | 164 syn keyword groovyJDKMethods newInputStream newOutputStream newPrintWriter newReader newWriter |
165 syn keyword groovyJDKMethods compareTo next previous isCase | |
799 | 166 syn keyword groovyJDKMethods times step toInteger upto any collect dump every find findAll grep |
3281 | 167 syn keyword groovyJDKMethods inspect invokeMethods join |
799 | 168 syn keyword groovyJDKMethods getErr getIn getOut waitForOrKill |
169 syn keyword groovyJDKMethods count tokenize asList flatten immutable intersect reverse reverseEach | |
3281 | 170 syn keyword groovyJDKMethods subMap append asWritable eachByte eachLine eachFile |
799 | 171 syn cluster groovyTop add=groovyJDKBuiltin,groovyJDKOperOverl,groovyJDKMethods |
172 | |
173 " no useful I think, so I comment it.. | |
174 "if filereadable(expand("<sfile>:p:h")."/groovyid.vim") | |
175 " source <sfile>:p:h/groovyid.vim | |
176 "endif | |
177 | |
178 if exists("groovy_space_errors") | |
179 if !exists("groovy_no_trail_space_error") | |
180 syn match groovySpaceError "\s\+$" | |
181 endif | |
182 if !exists("groovy_no_tab_space_error") | |
183 syn match groovySpaceError " \+\t"me=e-1 | |
184 endif | |
185 endif | |
186 | |
187 " it is a better case construct than java.vim to match groovy syntax | |
188 syn region groovyLabelRegion transparent matchgroup=groovyLabel start="\<case\>" matchgroup=NONE end=":\|$" contains=groovyNumber,groovyString,groovyLangClass,groovyJavaLangClass | |
189 syn match groovyUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=groovyLabel | |
190 syn keyword groovyLabel default | |
191 | |
192 if !exists("groovy_allow_cpp_keywords") | |
193 syn keyword groovyError auto delete extern friend inline redeclared | |
194 syn keyword groovyError register signed sizeof struct template typedef union | |
195 syn keyword groovyError unsigned operator | |
196 endif | |
197 | |
198 " The following cluster contains all groovy groups except the contained ones | |
199 syn cluster groovyTop add=groovyExternal,groovyError,groovyError,groovyBranch,groovyLabelRegion,groovyLabel,groovyConditional,groovyRepeat,groovyBoolean,groovyConstant,groovyTypedef,groovyOperator,groovyType,groovyType,groovyStatement,groovyStorageClass,groovyAssert,groovyExceptions,groovyMethodDecl,groovyClassDecl,groovyClassDecl,groovyClassDecl,groovyScopeDecl,groovyError,groovyError2,groovyUserLabel,groovyLangObject | |
200 | |
201 | |
202 " Comments | |
203 syn keyword groovyTodo contained TODO FIXME XXX | |
204 if exists("groovy_comment_strings") | |
205 syn region groovyCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=groovySpecial,groovyCommentStar,groovySpecialChar,@Spell | |
206 syn region groovyComment2String contained start=+"+ end=+$\|"+ contains=groovySpecial,groovySpecialChar,@Spell | |
207 syn match groovyCommentCharacter contained "'\\[^']\{1,6\}'" contains=groovySpecialChar | |
208 syn match groovyCommentCharacter contained "'\\''" contains=groovySpecialChar | |
209 syn match groovyCommentCharacter contained "'[^\\]'" | |
210 syn cluster groovyCommentSpecial add=groovyCommentString,groovyCommentCharacter,groovyNumber | |
211 syn cluster groovyCommentSpecial2 add=groovyComment2String,groovyCommentCharacter,groovyNumber | |
212 endif | |
213 syn region groovyComment start="/\*" end="\*/" contains=@groovyCommentSpecial,groovyTodo,@Spell | |
214 syn match groovyCommentStar contained "^\s*\*[^/]"me=e-1 | |
215 syn match groovyCommentStar contained "^\s*\*$" | |
216 syn match groovyLineComment "//.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell | |
217 GroovyHiLink groovyCommentString groovyString | |
218 GroovyHiLink groovyComment2String groovyString | |
219 GroovyHiLink groovyCommentCharacter groovyCharacter | |
220 | |
221 syn cluster groovyTop add=groovyComment,groovyLineComment | |
222 | |
223 if !exists("groovy_ignore_groovydoc") && main_syntax != 'jsp' | |
224 syntax case ignore | |
225 " syntax coloring for groovydoc comments (HTML) | |
226 " syntax include @groovyHtml <sfile>:p:h/html.vim | |
227 syntax include @groovyHtml runtime! syntax/html.vim | |
228 unlet b:current_syntax | |
2034 | 229 syntax spell default " added by Bram |
799 | 230 syn region groovyDocComment start="/\*\*" end="\*/" keepend contains=groovyCommentTitle,@groovyHtml,groovyDocTags,groovyTodo,@Spell |
231 syn region groovyCommentTitle contained matchgroup=groovyDocComment start="/\*\*" matchgroup=groovyCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@groovyHtml,groovyCommentStar,groovyTodo,@Spell,groovyDocTags | |
232 | |
233 syn region groovyDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" | |
234 syn match groovyDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=groovyDocParam | |
235 syn match groovyDocParam contained "\s\S\+" | |
236 syn match groovyDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" | |
237 syntax case match | |
238 endif | |
239 | |
240 " match the special comment /**/ | |
241 syn match groovyComment "/\*\*/" | |
242 | |
243 " Strings and constants | |
244 syn match groovySpecialError contained "\\." | |
245 syn match groovySpecialCharError contained "[^']" | |
4229 | 246 syn match groovySpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\|\$\)" |
247 syn match groovyRegexChar contained "\\." | |
799 | 248 syn region groovyString start=+"+ end=+"+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr |
2662 | 249 syn region groovyString start=+'+ end=+'+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell |
250 syn region groovyString start=+"""+ end=+"""+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr | |
251 syn region groovyString start=+'''+ end=+'''+ contains=groovySpecialChar,groovySpecialError,@Spell | |
9116
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
252 if exists("groovy_regex_strings") |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
253 " regex strings interfere with the division operator and thus are disabled |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
254 " by default |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
255 syn region groovyString start='/[^/*]' end='/' contains=groovySpecialChar,groovyRegexChar,groovyELExpr |
bc38030aec7d
commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
256 endif |
799 | 257 " syn region groovyELExpr start=+${+ end=+}+ keepend contained |
4229 | 258 syn match groovyELExpr /\${.\{-}}/ contained |
259 syn match groovyELExpr /\$[a-zA-Z_][a-zA-Z0-9_.]*/ contained | |
799 | 260 GroovyHiLink groovyELExpr Identifier |
261 | |
262 " TODO: better matching. I am waiting to understand how it really works in groovy | |
263 " syn region groovyClosureParamsBraces start=+|+ end=+|+ contains=groovyClosureParams | |
264 " syn match groovyClosureParams "[ a-zA-Z0-9_*]\+" contained | |
265 " GroovyHiLink groovyClosureParams Identifier | |
266 | |
267 " next line disabled, it can cause a crash for a long line | |
268 "syn match groovyStringError +"\([^"\\]\|\\.\)*$+ | |
269 | |
270 " disabled: in groovy strings or characters are written the same | |
271 " syn match groovyCharacter "'[^']*'" contains=groovySpecialChar,groovySpecialCharError | |
272 " syn match groovyCharacter "'\\''" contains=groovySpecialChar | |
273 " syn match groovyCharacter "'[^\\]'" | |
274 syn match groovyNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" | |
275 syn match groovyNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" | |
276 syn match groovyNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" | |
277 syn match groovyNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" | |
278 | |
279 " unicode characters | |
280 syn match groovySpecial "\\u\d\{4\}" | |
281 | |
282 syn cluster groovyTop add=groovyString,groovyCharacter,groovyNumber,groovySpecial,groovyStringError | |
283 | |
284 if exists("groovy_highlight_functions") | |
285 if groovy_highlight_functions == "indent" | |
286 syn match groovyFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses | |
287 syn region groovyFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses | |
288 syn match groovyFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses | |
289 syn region groovyFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses | |
290 else | |
291 " This line catches method declarations at any indentation>0, but it assumes | |
292 " two things: | |
293 " 1. class names are always capitalized (ie: Button) | |
294 " 2. method names are never capitalized (except constructors, of course) | |
295 syn region groovyFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,groovyComment,groovyLineComment,@groovyClasses | |
296 endif | |
297 syn match groovyBraces "[{}]" | |
298 syn cluster groovyTop add=groovyFuncDef,groovyBraces | |
299 endif | |
300 | |
301 if exists("groovy_highlight_debug") | |
302 | |
303 " Strings and constants | |
304 syn match groovyDebugSpecial contained "\\\d\d\d\|\\." | |
305 syn region groovyDebugString contained start=+"+ end=+"+ contains=groovyDebugSpecial | |
306 syn match groovyDebugStringError +"\([^"\\]\|\\.\)*$+ | |
307 syn match groovyDebugCharacter contained "'[^\\]'" | |
308 syn match groovyDebugSpecialCharacter contained "'\\.'" | |
309 syn match groovyDebugSpecialCharacter contained "'\\''" | |
310 syn match groovyDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" | |
311 syn match groovyDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" | |
312 syn match groovyDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" | |
313 syn match groovyDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" | |
314 syn keyword groovyDebugBoolean contained true false | |
315 syn keyword groovyDebugType contained null this super | |
316 syn region groovyDebugParen start=+(+ end=+)+ contained contains=groovyDebug.*,groovyDebugParen | |
317 | |
318 " to make this work you must define the highlighting for these groups | |
319 syn match groovyDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen | |
320 syn match groovyDebug "\<p\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen | |
321 syn match groovyDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen | |
322 syn match groovyDebug "\<trace[SL]\=\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen | |
323 | |
324 syn cluster groovyTop add=groovyDebug | |
325 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
326 GroovyHiLink groovyDebug Debug |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
327 GroovyHiLink groovyDebugString DebugString |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
328 GroovyHiLink groovyDebugStringError groovyError |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
329 GroovyHiLink groovyDebugType DebugType |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
330 GroovyHiLink groovyDebugBoolean DebugBoolean |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
331 GroovyHiLink groovyDebugNumber Debug |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
332 GroovyHiLink groovyDebugSpecial DebugSpecial |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
333 GroovyHiLink groovyDebugSpecialCharacter DebugSpecial |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
334 GroovyHiLink groovyDebugCharacter DebugString |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
335 GroovyHiLink groovyDebugParen Debug |
3281 | 336 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
337 GroovyHiLink DebugString String |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
338 GroovyHiLink DebugSpecial Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
339 GroovyHiLink DebugBoolean Boolean |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
340 GroovyHiLink DebugType Type |
799 | 341 endif |
342 | |
3281 | 343 " Match all Exception classes |
799 | 344 syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>" |
345 | |
346 | |
347 if !exists("groovy_minlines") | |
348 let groovy_minlines = 10 | |
349 endif | |
350 exec "syn sync ccomment groovyComment minlines=" . groovy_minlines | |
351 | |
352 | |
3281 | 353 " ################### |
799 | 354 " Groovy stuff |
355 " syn match groovyOperator "|[ ,a-zA-Z0-9_*]\+|" | |
356 | |
357 " All groovy valid tokens | |
358 " syn match groovyTokens ";\|,\|<=>\|<>\|:\|:=\|>\|>=\|=\|==\|<\|<=\|!=\|/\|/=\|\.\.|\.\.\.\|\~=\|\~==" | |
359 " syn match groovyTokens "\*=\|&\|&=\|\*\|->\|\~\|+\|-\|/\|?\|<<<\|>>>\|<<\|>>" | |
360 | |
361 " Must put explicit these ones because groovy.vim mark them as errors otherwise | |
362 " syn match groovyTokens "<=>\|<>\|==\~" | |
363 "syn cluster groovyTop add=groovyTokens | |
364 | |
365 " Mark these as operators | |
366 | |
367 " Hightlight brackets | |
368 " syn match groovyBraces "[{}]" | |
369 " syn match groovyBraces "[\[\]]" | |
370 " syn match groovyBraces "[\|]" | |
371 | |
372 if exists("groovy_mark_braces_in_parens_as_errors") | |
373 syn match groovyInParen contained "[{}]" | |
374 GroovyHiLink groovyInParen groovyError | |
375 syn cluster groovyTop add=groovyInParen | |
376 endif | |
377 | |
378 " catch errors caused by wrong parenthesis | |
379 syn region groovyParenT transparent matchgroup=groovyParen start="(" end=")" contains=@groovyTop,groovyParenT1 | |
380 syn region groovyParenT1 transparent matchgroup=groovyParen1 start="(" end=")" contains=@groovyTop,groovyParenT2 contained | |
381 syn region groovyParenT2 transparent matchgroup=groovyParen2 start="(" end=")" contains=@groovyTop,groovyParenT contained | |
382 syn match groovyParenError ")" | |
383 GroovyHiLink groovyParenError groovyError | |
384 | |
385 " catch errors caused by wrong square parenthesis | |
386 syn region groovyParenT transparent matchgroup=groovyParen start="\[" end="\]" contains=@groovyTop,groovyParenT1 | |
387 syn region groovyParenT1 transparent matchgroup=groovyParen1 start="\[" end="\]" contains=@groovyTop,groovyParenT2 contained | |
388 syn region groovyParenT2 transparent matchgroup=groovyParen2 start="\[" end="\]" contains=@groovyTop,groovyParenT contained | |
389 syn match groovyParenError "\]" | |
390 | |
391 " ############################### | |
392 " java.vim default highlighting | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
393 GroovyHiLink groovyFuncDef Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
394 GroovyHiLink groovyBraces Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
395 GroovyHiLink groovyBranch Conditional |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
396 GroovyHiLink groovyUserLabelRef groovyUserLabel |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
397 GroovyHiLink groovyLabel Label |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
398 GroovyHiLink groovyUserLabel Label |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
399 GroovyHiLink groovyConditional Conditional |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
400 GroovyHiLink groovyRepeat Repeat |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
401 GroovyHiLink groovyExceptions Exception |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
402 GroovyHiLink groovyAssert Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
403 GroovyHiLink groovyStorageClass StorageClass |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
404 GroovyHiLink groovyMethodDecl groovyStorageClass |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
405 GroovyHiLink groovyClassDecl groovyStorageClass |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
406 GroovyHiLink groovyScopeDecl groovyStorageClass |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
407 GroovyHiLink groovyBoolean Boolean |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
408 GroovyHiLink groovySpecial Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
409 GroovyHiLink groovySpecialError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
410 GroovyHiLink groovySpecialCharError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
411 GroovyHiLink groovyString String |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
412 GroovyHiLink groovyRegexChar String |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
413 GroovyHiLink groovyCharacter Character |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
414 GroovyHiLink groovySpecialChar SpecialChar |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
415 GroovyHiLink groovyNumber Number |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
416 GroovyHiLink groovyError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
417 GroovyHiLink groovyStringError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
418 GroovyHiLink groovyStatement Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
419 GroovyHiLink groovyOperator Operator |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
420 GroovyHiLink groovyComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
421 GroovyHiLink groovyDocComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
422 GroovyHiLink groovyLineComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
423 GroovyHiLink groovyConstant Constant |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
424 GroovyHiLink groovyTypedef Typedef |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
425 GroovyHiLink groovyTodo Todo |
3281 | 426 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
427 GroovyHiLink groovyCommentTitle SpecialComment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
428 GroovyHiLink groovyDocTags Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
429 GroovyHiLink groovyDocParam Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
430 GroovyHiLink groovyCommentStar groovyComment |
3281 | 431 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
432 GroovyHiLink groovyType Type |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
433 GroovyHiLink groovyExternal Include |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
434 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
435 GroovyHiLink htmlComment Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
436 GroovyHiLink htmlCommentPart Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
437 GroovyHiLink groovySpaceError Error |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
438 GroovyHiLink groovyJDKBuiltin Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
439 GroovyHiLink groovyJDKOperOverl Operator |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
9116
diff
changeset
|
440 GroovyHiLink groovyJDKMethods Function |
799 | 441 |
442 delcommand GroovyHiLink | |
443 | |
444 | |
445 let b:current_syntax = "groovy" | |
446 if main_syntax == 'groovy' | |
447 unlet main_syntax | |
448 endif | |
449 | |
450 let b:spell_options="contained" | |
451 | |
3281 | 452 let &cpo = s:cpo_save |
453 unlet s:cpo_save | |
454 | |
799 | 455 " vim: ts=8 |