Mercurial > vim
annotate runtime/syntax/java.vim @ 14354:ffd834f893aa v8.1.0192
patch 8.1.0192: executing regexp recursively fails with a crash
commit https://github.com/vim/vim/commit/0270f38e1ae484c31a80c813a08691c47a207f1a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 17 05:43:58 2018 +0200
patch 8.1.0192: executing regexp recursively fails with a crash
Problem: Executing regexp recursively fails with a crash.
Solution: Move global variables into "rex".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 17 Jul 2018 05:45:05 +0200 |
parents | 46763b01cd9a |
children | 2f7e67dd088c |
rev | line source |
---|---|
3854 | 1 " Vim syntax file |
2 " Language: Java | |
2152 | 3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> |
7 | 4 " URL: http://www.fleiner.com/vim/syntax/java.vim |
6648 | 5 " Last Change: 2015 March 01 |
7 | 6 |
7 " Please check :help java.vim for comments on some of the options available. | |
8 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6648
diff
changeset
|
9 " quit when a syntax file was already loaded |
7 | 10 if !exists("main_syntax") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6648
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 " we define it here so that included files can test for it | |
15 let main_syntax='java' | |
2034 | 16 syn region javaFold start="{" end="}" transparent fold |
7 | 17 endif |
18 | |
3854 | 19 let s:cpo_save = &cpo |
20 set cpo&vim | |
21 | |
7 | 22 " some characters that cannot be in a java program (outside a string) |
23 syn match javaError "[\\@`]" | |
6648 | 24 syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" |
3854 | 25 |
7 | 26 syn match javaOK "\.\.\." |
27 | |
28 " use separate name so that it can be deleted in javacc.vim | |
29 syn match javaError2 "#\|=<" | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
30 hi def link javaError2 javaError |
7 | 31 |
32 | |
33 | |
34 " keyword definitions | |
35 syn keyword javaExternal native package | |
856 | 36 syn match javaExternal "\<import\>\(\s\+static\>\)\?" |
7 | 37 syn keyword javaError goto const |
38 syn keyword javaConditional if else switch | |
39 syn keyword javaRepeat while for do | |
40 syn keyword javaBoolean true false | |
41 syn keyword javaConstant null | |
42 syn keyword javaTypedef this super | |
43 syn keyword javaOperator new instanceof | |
44 syn keyword javaType boolean char byte short int long float double | |
45 syn keyword javaType void | |
46 syn keyword javaStatement return | |
47 syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable | |
48 syn keyword javaExceptions throw try catch finally | |
49 syn keyword javaAssert assert | |
50 syn keyword javaMethodDecl synchronized throws | |
51 syn keyword javaClassDecl extends implements interface | |
52 " to differentiate the keyword class from MyClass.class we use a match here | |
53 syn match javaTypedef "\.\s*\<class\>"ms=s+1 | |
54 syn keyword javaClassDecl enum | |
55 syn match javaClassDecl "^class\>" | |
56 syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1 | |
6648 | 57 syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString |
2152 | 58 syn match javaClassDecl "@interface\>" |
7 | 59 syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite |
60 syn match javaUserLabelRef "\k\+" contained | |
856 | 61 syn match javaVarArg "\.\.\." |
7 | 62 syn keyword javaScopeDecl public protected private abstract |
63 | |
632 | 64 if exists("java_highlight_java_lang_ids") |
65 let java_highlight_all=1 | |
66 endif | |
2152 | 67 if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang") |
7 | 68 " java.lang.* |
69 syn match javaLangClass "\<System\>" | |
632 | 70 syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException |
71 syn cluster javaTop add=javaR_JavaLang | |
72 syn cluster javaClasses add=javaR_JavaLang | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
73 hi def link javaR_JavaLang javaR_Java |
632 | 74 syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary |
75 syn cluster javaTop add=javaC_JavaLang | |
76 syn cluster javaClasses add=javaC_JavaLang | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
77 hi def link javaC_JavaLang javaC_Java |
632 | 78 syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError |
79 syn cluster javaTop add=javaE_JavaLang | |
80 syn cluster javaClasses add=javaE_JavaLang | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
81 hi def link javaE_JavaLang javaE_Java |
632 | 82 syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException |
83 syn cluster javaTop add=javaX_JavaLang | |
84 syn cluster javaClasses add=javaX_JavaLang | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
85 hi def link javaX_JavaLang javaX_Java |
632 | 86 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
87 hi def link javaR_Java javaR_ |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link javaC_Java javaC_ |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link javaE_Java javaE_ |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link javaX_Java javaX_ |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link javaX_ javaExceptions |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link javaR_ javaExceptions |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link javaE_ javaExceptions |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link javaC_ javaConstant |
632 | 95 |
7 | 96 syn keyword javaLangObject clone equals finalize getClass hashCode |
97 syn keyword javaLangObject notify notifyAll toString wait | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link javaLangObject javaConstant |
632 | 99 syn cluster javaTop add=javaLangObject |
7 | 100 endif |
101 | |
102 if filereadable(expand("<sfile>:p:h")."/javaid.vim") | |
103 source <sfile>:p:h/javaid.vim | |
104 endif | |
105 | |
106 if exists("java_space_errors") | |
107 if !exists("java_no_trail_space_error") | |
2152 | 108 syn match javaSpaceError "\s\+$" |
7 | 109 endif |
110 if !exists("java_no_tab_space_error") | |
2152 | 111 syn match javaSpaceError " \+\t"me=e-1 |
7 | 112 endif |
113 endif | |
114 | |
6648 | 115 syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString |
2152 | 116 syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel |
7 | 117 syn keyword javaLabel default |
118 | |
3237 | 119 " highlighting C++ keywords as errors removed, too many people find it |
120 " annoying. Was: if !exists("java_allow_cpp_keywords") | |
7 | 121 |
122 " The following cluster contains all java groups except the contained ones | |
557 | 123 syn cluster javaTop add=javaExternal,javaError,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaScopeDecl,javaError,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg |
7 | 124 |
125 | |
126 " Comments | |
127 syn keyword javaTodo contained TODO FIXME XXX | |
128 if exists("java_comment_strings") | |
129 syn region javaCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=javaSpecial,javaCommentStar,javaSpecialChar,@Spell | |
2152 | 130 syn region javaComment2String contained start=+"+ end=+$\|"+ contains=javaSpecial,javaSpecialChar,@Spell |
7 | 131 syn match javaCommentCharacter contained "'\\[^']\{1,6\}'" contains=javaSpecialChar |
132 syn match javaCommentCharacter contained "'\\''" contains=javaSpecialChar | |
133 syn match javaCommentCharacter contained "'[^\\]'" | |
134 syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber | |
135 syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber | |
136 endif | |
137 syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell | |
2152 | 138 syn match javaCommentStar contained "^\s*\*[^/]"me=e-1 |
139 syn match javaCommentStar contained "^\s*\*$" | |
140 syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,@Spell | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
141 hi def link javaCommentString javaString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
142 hi def link javaComment2String javaString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
143 hi def link javaCommentCharacter javaCharacter |
7 | 144 |
145 syn cluster javaTop add=javaComment,javaLineComment | |
146 | |
147 if !exists("java_ignore_javadoc") && main_syntax != 'jsp' | |
148 syntax case ignore | |
149 " syntax coloring for javadoc comments (HTML) | |
150 syntax include @javaHtml <sfile>:p:h/html.vim | |
151 unlet b:current_syntax | |
2034 | 152 " HTML enables spell checking for all text that is not in a syntax item. This |
153 " is wrong for Java (all identifiers would be spell-checked), so it's undone | |
154 " here. | |
155 syntax spell default | |
156 | |
2152 | 157 syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell |
158 syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag | |
7 | 159 |
3854 | 160 syn region javaDocTags contained start="{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" |
2152 | 161 syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam |
162 syn match javaDocParam contained "\s\S\+" | |
163 syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" | |
164 syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam | |
632 | 165 syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend |
7 | 166 syntax case match |
167 endif | |
168 | |
169 " match the special comment /**/ | |
170 syn match javaComment "/\*\*/" | |
171 | |
172 " Strings and constants | |
2152 | 173 syn match javaSpecialError contained "\\." |
7 | 174 syn match javaSpecialCharError contained "[^']" |
2152 | 175 syn match javaSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)" |
7 | 176 syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaSpecialError,@Spell |
177 " next line disabled, it can cause a crash for a long line | |
178 "syn match javaStringError +"\([^"\\]\|\\.\)*$+ | |
179 syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError | |
180 syn match javaCharacter "'\\''" contains=javaSpecialChar | |
181 syn match javaCharacter "'[^\\]'" | |
6648 | 182 syn match javaNumber "\<\(0[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[lL]\=\>" |
183 syn match javaNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\=" | |
184 syn match javaNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>" | |
185 syn match javaNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>" | |
7 | 186 |
187 " unicode characters | |
2152 | 188 syn match javaSpecial "\\u\d\{4\}" |
7 | 189 |
190 syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStringError | |
191 | |
192 if exists("java_highlight_functions") | |
193 if java_highlight_functions == "indent" | |
6648 | 194 syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation |
195 syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation | |
196 syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation | |
197 syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation | |
7 | 198 else |
199 " This line catches method declarations at any indentation>0, but it assumes | |
200 " two things: | |
2152 | 201 " 1. class names are always capitalized (ie: Button) |
202 " 2. method names are never capitalized (except constructors, of course) | |
6648 | 203 "syn region javaFuncDef 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=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses |
204 syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(<.*>\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*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation | |
7 | 205 endif |
6648 | 206 syn match javaLambdaDef "[a-zA-Z_][a-zA-Z0-9_]*\s*->" |
7 | 207 syn match javaBraces "[{}]" |
6648 | 208 syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef |
7 | 209 endif |
210 | |
211 if exists("java_highlight_debug") | |
212 | |
213 " Strings and constants | |
214 syn match javaDebugSpecial contained "\\\d\d\d\|\\." | |
215 syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial | |
2152 | 216 syn match javaDebugStringError +"\([^"\\]\|\\.\)*$+ |
7 | 217 syn match javaDebugCharacter contained "'[^\\]'" |
218 syn match javaDebugSpecialCharacter contained "'\\.'" | |
219 syn match javaDebugSpecialCharacter contained "'\\''" | |
220 syn match javaDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" | |
221 syn match javaDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" | |
222 syn match javaDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" | |
223 syn match javaDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" | |
224 syn keyword javaDebugBoolean contained true false | |
225 syn keyword javaDebugType contained null this super | |
226 syn region javaDebugParen start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen | |
227 | |
228 " to make this work you must define the highlighting for these groups | |
229 syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen | |
36 | 230 syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen |
7 | 231 syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen |
232 syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen | |
233 | |
234 syn cluster javaTop add=javaDebug | |
235 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
236 hi def link javaDebug Debug |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
237 hi def link javaDebugString DebugString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
238 hi def link javaDebugStringError javaError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
239 hi def link javaDebugType DebugType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
240 hi def link javaDebugBoolean DebugBoolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
241 hi def link javaDebugNumber Debug |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
242 hi def link javaDebugSpecial DebugSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
243 hi def link javaDebugSpecialCharacter DebugSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
244 hi def link javaDebugCharacter DebugString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
245 hi def link javaDebugParen Debug |
7 | 246 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
247 hi def link DebugString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
248 hi def link DebugSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
249 hi def link DebugBoolean Boolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
250 hi def link DebugType Type |
7 | 251 endif |
252 | |
253 if exists("java_mark_braces_in_parens_as_errors") | |
254 syn match javaInParen contained "[{}]" | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
255 hi def link javaInParen javaError |
7 | 256 syn cluster javaTop add=javaInParen |
257 endif | |
258 | |
259 " catch errors caused by wrong parenthesis | |
6648 | 260 syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1 |
7 | 261 syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained |
262 syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained | |
2152 | 263 syn match javaParenError ")" |
36 | 264 " catch errors caused by wrong square parenthesis |
6648 | 265 syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1 |
36 | 266 syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained |
267 syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained | |
2152 | 268 syn match javaParenError "\]" |
36 | 269 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
270 hi def link javaParenError javaError |
7 | 271 |
6648 | 272 if exists("java_highlight_functions") |
273 syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->" | |
274 " needs to be defined after the parenthesis error catcher to work | |
275 endif | |
276 | |
7 | 277 if !exists("java_minlines") |
278 let java_minlines = 10 | |
279 endif | |
280 exec "syn sync ccomment javaComment minlines=" . java_minlines | |
281 | |
282 " The default highlighting. | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
283 hi def link javaLambdaDef Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
284 hi def link javaFuncDef Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
285 hi def link javaVarArg Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
286 hi def link javaBraces Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
287 hi def link javaBranch Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
288 hi def link javaUserLabelRef javaUserLabel |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
289 hi def link javaLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
290 hi def link javaUserLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
291 hi def link javaConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
292 hi def link javaRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
293 hi def link javaExceptions Exception |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
294 hi def link javaAssert Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
295 hi def link javaStorageClass StorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
296 hi def link javaMethodDecl javaStorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
297 hi def link javaClassDecl javaStorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
298 hi def link javaScopeDecl javaStorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
299 hi def link javaBoolean Boolean |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
300 hi def link javaSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
301 hi def link javaSpecialError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
302 hi def link javaSpecialCharError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
303 hi def link javaString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
304 hi def link javaCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
305 hi def link javaSpecialChar SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
306 hi def link javaNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
307 hi def link javaError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
308 hi def link javaStringError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
309 hi def link javaStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
310 hi def link javaOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
311 hi def link javaComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
312 hi def link javaDocComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
313 hi def link javaLineComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
314 hi def link javaConstant Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
315 hi def link javaTypedef Typedef |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
316 hi def link javaTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
317 hi def link javaAnnotation PreProc |
7 | 318 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
319 hi def link javaCommentTitle SpecialComment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
320 hi def link javaDocTags Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
321 hi def link javaDocParam Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
322 hi def link javaDocSeeTagParam Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
323 hi def link javaCommentStar javaComment |
7 | 324 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
325 hi def link javaType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
326 hi def link javaExternal Include |
7 | 327 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
328 hi def link htmlComment Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
329 hi def link htmlCommentPart Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
330 hi def link javaSpaceError Error |
7 | 331 |
332 let b:current_syntax = "java" | |
333 | |
334 if main_syntax == 'java' | |
335 unlet main_syntax | |
336 endif | |
337 | |
338 let b:spell_options="contained" | |
3854 | 339 let &cpo = s:cpo_save |
340 unlet s:cpo_save | |
7 | 341 |
342 " vim: ts=8 |