annotate runtime/syntax/java.vim @ 29150:d1fe80fb35e6

Update runtime files Commit: https://github.com/vim/vim/commit/8c1b8cb2e0b52d0853f85c2096a2f22dbc57a788 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 14 17:41:28 2022 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 Jun 2022 18:45:04 +0200
parents c58baa6d6dda
children 8e12f762d055
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
1 " Vim syntax file
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
2 " Language: Java
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
4 " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
5 " Last Change: 2022 Jun 08
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Please check :help java.vim for comments on some of the options available.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " we define it here so that included files can test for it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let main_syntax='java'
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
16 syn region javaFold start="{" end="}" transparent fold
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
19 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
20 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
21
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " some characters that cannot be in a java program (outside a string)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match javaError "[\\@`]"
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
24 syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
25
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " use separate name so that it can be deleted in javacc.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match javaError2 "#\|=<"
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
28 hi def link javaError2 javaError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " keyword definitions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword javaExternal native package
856
8cd729851562 updated for version 7.0g
vimboss
parents: 632
diff changeset
32 syn match javaExternal "\<import\>\(\s\+static\>\)\?"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword javaError goto const
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword javaConditional if else switch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword javaRepeat while for do
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword javaBoolean true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword javaConstant null
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword javaTypedef this super
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
39 syn keyword javaOperator var new instanceof
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword javaType boolean char byte short int long float double
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword javaType void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword javaStatement return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword javaExceptions throw try catch finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword javaAssert assert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword javaMethodDecl synchronized throws
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword javaClassDecl extends implements interface
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " to differentiate the keyword class from MyClass.class we use a match here
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match javaTypedef "\.\s*\<class\>"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword javaClassDecl enum
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match javaClassDecl "^class\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
53 syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
54 syn match javaClassDecl "@interface\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match javaUserLabelRef "\k\+" contained
856
8cd729851562 updated for version 7.0g
vimboss
parents: 632
diff changeset
57 syn match javaVarArg "\.\.\."
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword javaScopeDecl public protected private abstract
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
60 function s:isModuleInfoDeclarationCurrentBuffer() abort
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
61 return fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!'
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
62 endfunction
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
63
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
64 " Java Modules(Since Java 9, for "module-info.java" file)
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
65 if s:isModuleInfoDeclarationCurrentBuffer()
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
66 syn keyword javaModuleStorageClass module transitive
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
67 syn keyword javaModuleStmt open requires exports opens uses provides
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
68 syn keyword javaModuleExternal to with
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
69 syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
70 endif
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
71
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
72 if exists("java_highlight_java_lang_ids")
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
73 let java_highlight_all=1
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
74 endif
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
75 if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " java.lang.*
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
77 "
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
78 " The keywords of javaR_JavaLang, javaC_JavaLang, javaE_JavaLang,
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
79 " and javaX_JavaLang are sub-grouped according to the Java version
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
80 " of their introduction, and sub-group keywords (that is, class
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
81 " names) are arranged in alphabetical order, so that future newer
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
82 " keywords can be pre-sorted and appended without disturbing
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
83 " the current keyword placement. The below _match_es follow suit.
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
84
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
85 syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
86 syn cluster javaTop add=javaR_JavaLang
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
87 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
88 hi def link javaR_JavaLang javaR_Java
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
89 " Member enumerations:
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
90 syn match javaC_JavaLang "\%(\<Thread\.\)\@<=\<State\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
91 syn match javaC_JavaLang "\%(\<Character\.\)\@<=\<UnicodeScript\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
92 syn match javaC_JavaLang "\%(\<ProcessBuilder\.Redirect\.\)\@<=\<Type\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
93 syn match javaC_JavaLang "\%(\<StackWalker\.\)\@<=\<Option\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
94 syn match javaC_JavaLang "\%(\<System\.Logger\.\)\@<=\<Level\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
95 " Member classes:
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
96 syn match javaC_JavaLang "\%(\<Character\.\)\@<=\<Subset\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
97 syn match javaC_JavaLang "\%(\<Character\.\)\@<=\<UnicodeBlock\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
98 syn match javaC_JavaLang "\%(\<ProcessBuilder\.\)\@<=\<Redirect\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
99 syn match javaC_JavaLang "\%(\<ModuleLayer\.\)\@<=\<Controller\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
100 syn match javaC_JavaLang "\%(\<Runtime\.\)\@<=\<Version\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
101 syn match javaC_JavaLang "\%(\<System\.\)\@<=\<LoggerFinder\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
102 syn match javaC_JavaLang "\%(\<Enum\.\)\@<=\<EnumDesc\>"
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
103 syn keyword javaC_JavaLang Boolean Character Class ClassLoader Compiler Double Float Integer Long Math Number Object Process Runtime SecurityManager String StringBuffer Thread ThreadGroup Byte Short Void InheritableThreadLocal Package RuntimePermission ThreadLocal StrictMath StackTraceElement Enum ProcessBuilder StringBuilder ClassValue Module ModuleLayer StackWalker Record
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
104 syn match javaC_JavaLang "\<System\>" " See javaDebug.
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
105 syn cluster javaTop add=javaC_JavaLang
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
106 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
107 hi def link javaC_JavaLang javaC_Java
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
108 syn keyword javaE_JavaLang AbstractMethodError ClassCircularityError ClassFormatError Error IllegalAccessError IncompatibleClassChangeError InstantiationError InternalError LinkageError NoClassDefFoundError NoSuchFieldError NoSuchMethodError OutOfMemoryError StackOverflowError ThreadDeath UnknownError UnsatisfiedLinkError VerifyError VirtualMachineError ExceptionInInitializerError UnsupportedClassVersionError AssertionError BootstrapMethodError
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
109 syn cluster javaTop add=javaE_JavaLang
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
110 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
111 hi def link javaE_JavaLang javaE_Java
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
112 syn keyword javaX_JavaLang ClassNotFoundException CloneNotSupportedException Exception IllegalAccessException InstantiationException InterruptedException NoSuchMethodException Throwable NoSuchFieldException ReflectiveOperationException
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
113 syn cluster javaTop add=javaX_JavaLang
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
114 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
115 hi def link javaX_JavaLang javaX_Java
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
116
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
117 hi def link javaR_Java javaR_
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
118 hi def link javaC_Java javaC_
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
119 hi def link javaE_Java javaE_
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
120 hi def link javaX_Java javaX_
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
121 hi def link javaX_ javaExceptions
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
122 hi def link javaR_ javaExceptions
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
123 hi def link javaE_ javaExceptions
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
124 hi def link javaC_ javaConstant
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
125
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 syn keyword javaLangObject clone equals finalize getClass hashCode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 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
128 hi def link javaLangObject javaConstant
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
129 syn cluster javaTop add=javaLangObject
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 if filereadable(expand("<sfile>:p:h")."/javaid.vim")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 source <sfile>:p:h/javaid.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 if exists("java_space_errors")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 if !exists("java_no_trail_space_error")
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
138 syn match javaSpaceError "\s\+$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 if !exists("java_no_tab_space_error")
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
141 syn match javaSpaceError " \+\t"me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
145 syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" end="->" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
146 syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn keyword javaLabel default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2152
diff changeset
149 " highlighting C++ keywords as errors removed, too many people find it
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2152
diff changeset
150 " annoying. Was: if !exists("java_allow_cpp_keywords")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 " The following cluster contains all java groups except the contained ones
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
153 syn cluster javaTop add=javaExternal,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaScopeDecl,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 syn keyword javaTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 if exists("java_comment_strings")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 syn region javaCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=javaSpecial,javaCommentStar,javaSpecialChar,@Spell
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
160 syn region javaComment2String contained start=+"+ end=+$\|"+ contains=javaSpecial,javaSpecialChar,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 syn match javaCommentCharacter contained "'\\[^']\{1,6\}'" contains=javaSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 syn match javaCommentCharacter contained "'\\''" contains=javaSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 syn match javaCommentCharacter contained "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
168 syn match javaCommentStar contained "^\s*\*[^/]"me=e-1
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
169 syn match javaCommentStar contained "^\s*\*$"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
170 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
171 hi def link javaCommentString javaString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
172 hi def link javaComment2String javaString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
173 hi def link javaCommentCharacter javaCharacter
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 syn cluster javaTop add=javaComment,javaLineComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 syntax case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 " syntax coloring for javadoc comments (HTML)
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
180 syntax include @javaHtml syntax/html.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 unlet b:current_syntax
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
182 " HTML enables spell checking for all text that is not in a syntax item. This
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
183 " is wrong for Java (all identifiers would be spell-checked), so it's undone
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
184 " here.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
185 syntax spell default
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1621
diff changeset
186
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
187 syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
188 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
190 syn region javaDocTags contained start="{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
191 syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
192 syn match javaDocParam contained "\s\S\+"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
193 syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
194 syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 557
diff changeset
195 syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syntax case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 " match the special comment /**/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 syn match javaComment "/\*\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 " Strings and constants
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
203 syn match javaSpecialError contained "\\."
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 syn match javaSpecialCharError contained "[^']"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
205 syn match javaSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaSpecialError,@Spell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 " next line disabled, it can cause a crash for a long line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 "syn match javaStringError +"\([^"\\]\|\\.\)*$+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn match javaCharacter "'\\''" contains=javaSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn match javaCharacter "'[^\\]'"
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
212 syn match javaNumber "\<\(0[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[lL]\=\>"
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
213 syn match javaNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\="
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
214 syn match javaNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>"
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
215 syn match javaNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 " unicode characters
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
218 syn match javaSpecial "\\u\d\{4\}"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStringError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 if exists("java_highlight_functions")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 if java_highlight_functions == "indent"
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
224 syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
225 syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
226 syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
227 syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 " This line catches method declarations at any indentation>0, but it assumes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 " two things:
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
231 " 1. class names are always capitalized (ie: Button)
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
232 " 2. method names are never capitalized (except constructors, of course)
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
233 "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
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
234 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 endif
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
236 syn match javaLambdaDef "[a-zA-Z_][a-zA-Z0-9_]*\s*->"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 syn match javaBraces "[{}]"
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
238 syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 if exists("java_highlight_debug")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 " Strings and constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 syn match javaDebugSpecial contained "\\\d\d\d\|\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
246 syn match javaDebugStringError +"\([^"\\]\|\\.\)*$+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 syn match javaDebugCharacter contained "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 syn match javaDebugSpecialCharacter contained "'\\.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 syn match javaDebugSpecialCharacter contained "'\\''"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 syn match javaDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 syn match javaDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 syn match javaDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 syn match javaDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 syn keyword javaDebugBoolean contained true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 syn keyword javaDebugType contained null this super
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 syn region javaDebugParen start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 " to make this work you must define the highlighting for these groups
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
260 syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 syn cluster javaTop add=javaDebug
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
266 hi def link javaDebug Debug
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
267 hi def link javaDebugString DebugString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
268 hi def link javaDebugStringError javaError
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
269 hi def link javaDebugType DebugType
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
270 hi def link javaDebugBoolean DebugBoolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
271 hi def link javaDebugNumber Debug
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
272 hi def link javaDebugSpecial DebugSpecial
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
273 hi def link javaDebugSpecialCharacter DebugSpecial
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
274 hi def link javaDebugCharacter DebugString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
275 hi def link javaDebugParen Debug
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
277 hi def link DebugString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
278 hi def link DebugSpecial Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
279 hi def link DebugBoolean Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
280 hi def link DebugType Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 if exists("java_mark_braces_in_parens_as_errors")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 syn match javaInParen contained "[{}]"
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
285 hi def link javaInParen javaError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 syn cluster javaTop add=javaInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 " catch errors caused by wrong parenthesis
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
290 syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
293 syn match javaParenError ")"
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
294 " catch errors caused by wrong square parenthesis
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
295 syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
296 syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
297 syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
298 syn match javaParenError "\]"
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
299
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
300 hi def link javaParenError javaError
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
6648
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
302 if exists("java_highlight_functions")
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
303 syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->"
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
304 " needs to be defined after the parenthesis error catcher to work
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
305 endif
099f8b730941 Update a few runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
306
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 if !exists("java_minlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 let java_minlines = 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 exec "syn sync ccomment javaComment minlines=" . java_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 " The default highlighting.
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
313 hi def link javaLambdaDef Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
314 hi def link javaFuncDef Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
315 hi def link javaVarArg Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
316 hi def link javaBraces Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
317 hi def link javaBranch Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
318 hi def link javaUserLabelRef javaUserLabel
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
319 hi def link javaLabel Label
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
320 hi def link javaUserLabel Label
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
321 hi def link javaConditional Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
322 hi def link javaRepeat Repeat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
323 hi def link javaExceptions Exception
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
324 hi def link javaAssert Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
325 hi def link javaStorageClass StorageClass
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
326 hi def link javaMethodDecl javaStorageClass
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
327 hi def link javaClassDecl javaStorageClass
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
328 hi def link javaScopeDecl javaStorageClass
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
329
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
330 hi def link javaBoolean Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
331 hi def link javaSpecial Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
332 hi def link javaSpecialError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
333 hi def link javaSpecialCharError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
334 hi def link javaString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
335 hi def link javaCharacter Character
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
336 hi def link javaSpecialChar SpecialChar
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
337 hi def link javaNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
338 hi def link javaError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
339 hi def link javaStringError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
340 hi def link javaStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
341 hi def link javaOperator Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
342 hi def link javaComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
343 hi def link javaDocComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
344 hi def link javaLineComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
345 hi def link javaConstant Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
346 hi def link javaTypedef Typedef
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
347 hi def link javaTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
348 hi def link javaAnnotation PreProc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
350 hi def link javaCommentTitle SpecialComment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
351 hi def link javaDocTags Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
352 hi def link javaDocParam Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
353 hi def link javaDocSeeTagParam Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
354 hi def link javaCommentStar javaComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
356 hi def link javaType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
357 hi def link javaExternal Include
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
359 hi def link htmlComment Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
360 hi def link htmlCommentPart Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
361 hi def link javaSpaceError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
363 if s:isModuleInfoDeclarationCurrentBuffer()
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
364 hi def link javaModuleStorageClass StorageClass
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
365 hi def link javaModuleStmt Statement
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
366 hi def link javaModuleExternal Include
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
367 endif
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
368
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 let b:current_syntax = "java"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 if main_syntax == 'java'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
29104
c58baa6d6dda Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
375 delfunction! s:isModuleInfoDeclarationCurrentBuffer
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 let b:spell_options="contained"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
377 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
378 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 " vim: ts=8