annotate runtime/syntax/groovy.vim @ 4972:537bbfff0c5c v7.3.1231

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