PageRenderTime 69ms CodeModel.GetById 62ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/modes/groovy.xml

#
XML | 261 lines | 240 code | 11 blank | 10 comment | 0 complexity | caead33cc62b1f00529ded4ba9368734 MD5 | raw file
  1<?xml version="1.0"?>
  2<!DOCTYPE MODE SYSTEM "xmode.dtd">
  3
  4<!--
  5<MODE NAME="groovy"			FILE="groovy.xml"
  6				FILE_NAME_GLOB="*.{groovy,grv}"/>
  7-->
  8
  9<MODE>
 10	<PROPS>
 11		<PROPERTY NAME="commentStart" VALUE="/*" />
 12		<PROPERTY NAME="commentEnd" VALUE="*/" />
 13		<PROPERTY NAME="lineComment" VALUE="//" />
 14		<PROPERTY NAME="indentOpenBrackets" VALUE="{" />
 15		<PROPERTY NAME="indentCloseBrackets" VALUE="}" />
 16		<PROPERTY NAME="indentNextLine"
 17			VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
 18	</PROPS>
 19
 20	<RULES ESCAPE="\" HIGHLIGHT_DIGITS="TRUE" IGNORE_CASE="FALSE">
 21		<!-- Silly comment -->
 22		<SEQ TYPE="COMMENT1">/**/</SEQ>
 23
 24		<!-- Javadoc comment -->
 25		<SPAN TYPE="COMMENT3" DELEGATE="GROOVYDOC">
 26			<BEGIN>/**</BEGIN>
 27			<END>*/</END>
 28		</SPAN>
 29
 30		<!-- Java comment (C style) -->
 31		<SPAN TYPE="COMMENT1">
 32			<BEGIN>/*</BEGIN>
 33			<END>*/</END>
 34		</SPAN>
 35
 36		<SPAN TYPE="LITERAL1" DELEGATE="LITERAL">
 37			<BEGIN>"</BEGIN>
 38			<END>"</END>
 39		</SPAN>
 40		<SPAN TYPE="LITERAL1">
 41			<BEGIN>'</BEGIN>
 42			<END>'</END>
 43		</SPAN>
 44
 45		<!-- heredoc -->
 46		<SPAN_REGEXP HASH_CHAR="&lt;" TYPE="LITERAL1" DELEGATE="LITERAL">
 47			<BEGIN><![CDATA[<<<([\p{Alpha}_][\p{Alnum}_]*)\s*]]></BEGIN>
 48			<END>$1</END>
 49		</SPAN_REGEXP>
 50
 51		<SEQ TYPE="OPERATOR">=~</SEQ>
 52		<SEQ TYPE="OPERATOR">=</SEQ>
 53		<SEQ TYPE="OPERATOR">|</SEQ>
 54		<SEQ TYPE="OPERATOR">!</SEQ>
 55		<SEQ TYPE="OPERATOR">&lt;=&gt;</SEQ>
 56		<SEQ TYPE="OPERATOR">&gt;=</SEQ>
 57		<SEQ TYPE="OPERATOR">&lt;=</SEQ>
 58		<SEQ TYPE="OPERATOR">+</SEQ>
 59		<SEQ TYPE="OPERATOR">-&gt;</SEQ>
 60		<SEQ TYPE="OPERATOR">-</SEQ>
 61		<SEQ TYPE="OPERATOR">?</SEQ>
 62		<SEQ TYPE="OPERATOR">&amp;</SEQ>
 63
 64		<!-- workaround to stop "*" from being colorized
 65		     in import statements. -->
 66		<SEQ TYPE="NULL">.*</SEQ>
 67
 68		<!-- Comments -->
 69		<EOL_SPAN TYPE="COMMENT1">//</EOL_SPAN>
 70
 71		<!-- Function calls -->
 72		<MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 73
 74		<KEYWORDS>
 75			<KEYWORD1>abstract</KEYWORD1>
 76			<KEYWORD1>break</KEYWORD1>
 77			<KEYWORD1>case</KEYWORD1>
 78			<KEYWORD1>catch</KEYWORD1>
 79			<KEYWORD1>continue</KEYWORD1>
 80			<KEYWORD1>default</KEYWORD1>
 81			<KEYWORD1>do</KEYWORD1>
 82			<KEYWORD1>else</KEYWORD1>
 83			<KEYWORD1>extends</KEYWORD1>
 84			<KEYWORD1>final</KEYWORD1>
 85			<KEYWORD1>finally</KEYWORD1>
 86			<KEYWORD1>for</KEYWORD1>
 87			<KEYWORD1>if</KEYWORD1>
 88			<KEYWORD1>implements</KEYWORD1>
 89			<KEYWORD1>instanceof</KEYWORD1>
 90			<KEYWORD1>native</KEYWORD1>
 91			<KEYWORD1>new</KEYWORD1>
 92			<KEYWORD1>private</KEYWORD1>
 93			<KEYWORD1>protected</KEYWORD1>
 94			<KEYWORD1>public</KEYWORD1>
 95			<KEYWORD1>return</KEYWORD1>
 96			<KEYWORD1>static</KEYWORD1>
 97			<KEYWORD1>switch</KEYWORD1>
 98			<KEYWORD1>synchronized</KEYWORD1>
 99			<KEYWORD1>throw</KEYWORD1>
100			<KEYWORD1>throws</KEYWORD1>
101			<KEYWORD1>transient</KEYWORD1>
102			<KEYWORD1>try</KEYWORD1>
103			<KEYWORD1>volatile</KEYWORD1>
104			<KEYWORD1>while</KEYWORD1>
105
106			<KEYWORD1>strictfp</KEYWORD1>
107
108			<KEYWORD1>package</KEYWORD1>
109			<KEYWORD1>import</KEYWORD1>
110
111			<!-- groovy keywords -->
112			<KEYWORD2>as</KEYWORD2>
113			<KEYWORD2>assert</KEYWORD2>
114			<KEYWORD2>def</KEYWORD2>
115			<KEYWORD2>mixin</KEYWORD2>
116			<KEYWORD2>property</KEYWORD2>
117			<KEYWORD2>test</KEYWORD2>
118			<KEYWORD2>using</KEYWORD2>
119			<KEYWORD2>in</KEYWORD2>
120
121			<!-- types -->
122			<KEYWORD3>boolean</KEYWORD3>
123			<KEYWORD3>byte</KEYWORD3>
124			<KEYWORD3>char</KEYWORD3>
125			<KEYWORD3>class</KEYWORD3>
126			<KEYWORD3>double</KEYWORD3>
127			<KEYWORD3>float</KEYWORD3>
128			<KEYWORD3>int</KEYWORD3>
129			<KEYWORD3>interface</KEYWORD3>
130			<KEYWORD3>long</KEYWORD3>
131			<KEYWORD3>short</KEYWORD3>
132			<KEYWORD3>void</KEYWORD3>
133
134			<!-- Groovy JDK stuff -->
135			<KEYWORD4>abs</KEYWORD4>
136			<KEYWORD4>any</KEYWORD4>
137			<KEYWORD4>append</KEYWORD4>
138			<KEYWORD4>asList</KEYWORD4>
139			<KEYWORD4>asWritable</KEYWORD4>
140			<KEYWORD4>call</KEYWORD4>
141			<KEYWORD4>collect</KEYWORD4>
142			<KEYWORD4>compareTo</KEYWORD4>
143			<KEYWORD4>count</KEYWORD4>
144			<KEYWORD4>div</KEYWORD4>
145			<KEYWORD4>dump</KEYWORD4>
146			<KEYWORD4>each</KEYWORD4>
147			<KEYWORD4>eachByte</KEYWORD4>
148			<KEYWORD4>eachFile</KEYWORD4>
149			<KEYWORD4>eachLine</KEYWORD4>
150			<KEYWORD4>every</KEYWORD4>
151			<KEYWORD4>find</KEYWORD4>
152			<KEYWORD4>findAll</KEYWORD4>
153			<KEYWORD4>flatten</KEYWORD4>
154			<KEYWORD4>getAt</KEYWORD4>
155			<KEYWORD4>getErr</KEYWORD4>
156			<KEYWORD4>getIn</KEYWORD4>
157			<KEYWORD4>getOut</KEYWORD4>
158			<KEYWORD4>getText</KEYWORD4>
159			<KEYWORD4>grep</KEYWORD4>
160			<KEYWORD4>immutable</KEYWORD4>
161			<KEYWORD4>inject</KEYWORD4>
162			<KEYWORD4>inspect</KEYWORD4>
163			<KEYWORD4>intersect</KEYWORD4>
164			<KEYWORD4>invokeMethods</KEYWORD4>
165			<KEYWORD4>isCase</KEYWORD4>
166			<KEYWORD4>join</KEYWORD4>
167			<KEYWORD4>leftShift</KEYWORD4>
168			<KEYWORD4>minus</KEYWORD4>
169			<KEYWORD4>multiply</KEYWORD4>
170			<KEYWORD4>newInputStream</KEYWORD4>
171			<KEYWORD4>newOutputStream</KEYWORD4>
172			<KEYWORD4>newPrintWriter</KEYWORD4>
173			<KEYWORD4>newReader</KEYWORD4>
174			<KEYWORD4>newWriter</KEYWORD4>
175			<KEYWORD4>next</KEYWORD4>
176			<KEYWORD4>plus</KEYWORD4>
177			<KEYWORD4>pop</KEYWORD4>
178			<KEYWORD4>power</KEYWORD4>
179			<KEYWORD4>previous</KEYWORD4>
180			<KEYWORD4>print</KEYWORD4>
181			<KEYWORD4>println</KEYWORD4>
182			<KEYWORD4>push</KEYWORD4>
183			<KEYWORD4>putAt</KEYWORD4>
184			<KEYWORD4>read</KEYWORD4>
185			<KEYWORD4>readBytes</KEYWORD4>
186			<KEYWORD4>readLines</KEYWORD4>
187			<KEYWORD4>reverse</KEYWORD4>
188			<KEYWORD4>reverseEach</KEYWORD4>
189			<KEYWORD4>round</KEYWORD4>
190			<KEYWORD4>size</KEYWORD4>
191			<KEYWORD4>sort</KEYWORD4>
192			<KEYWORD4>splitEachLine</KEYWORD4>
193			<KEYWORD4>step</KEYWORD4>
194			<KEYWORD4>subMap</KEYWORD4>
195			<KEYWORD4>times</KEYWORD4>
196			<KEYWORD4>toInteger</KEYWORD4>
197			<KEYWORD4>toList</KEYWORD4>
198			<KEYWORD4>tokenize</KEYWORD4>
199			<KEYWORD4>upto</KEYWORD4>
200			<KEYWORD4>waitForOrKill</KEYWORD4>
201			<KEYWORD4>withPrintWriter</KEYWORD4>
202			<KEYWORD4>withReader</KEYWORD4>
203			<KEYWORD4>withStream</KEYWORD4>
204			<KEYWORD4>withWriter</KEYWORD4>
205			<KEYWORD4>withWriterAppend</KEYWORD4>
206			<KEYWORD4>write</KEYWORD4>
207			<KEYWORD4>writeLine</KEYWORD4>
208
209			<LITERAL2>false</LITERAL2>
210			<LITERAL2>null</LITERAL2>
211			<LITERAL2>super</LITERAL2>
212			<LITERAL2>this</LITERAL2>
213			<LITERAL2>true</LITERAL2>
214
215			<!-- this is specific to groovy, treat like `this`? -->
216			<LITERAL3>it</LITERAL3>
217
218			<INVALID>goto</INVALID>
219			<INVALID>const</INVALID>
220		</KEYWORDS>
221	</RULES>
222
223	<RULES SET="LITERAL" DEFAULT="LITERAL1" ESCAPE="\">
224		<!-- Variables -->
225		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
226			<BEGIN>${</BEGIN>
227			<END>}</END>
228		</SPAN>
229
230		<MARK_FOLLOWING TYPE="KEYWORD2">$</MARK_FOLLOWING>
231	</RULES>
232
233	<RULES SET="GROOVYDOC" DEFAULT="COMMENT3" IGNORE_CASE="TRUE">
234		<!-- so that @link{...} is highlighted -->
235		<SEQ TYPE="COMMENT3">{</SEQ>
236
237		<!-- so that *@param is highlighted -->
238		<SEQ TYPE="COMMENT3">*</SEQ>
239
240		<!-- HTML comments -->
241		<SPAN TYPE="COMMENT1">
242			<BEGIN>&lt;!--</BEGIN>
243			<END>--&gt;</END>
244		</SPAN>
245
246		<!-- Javadoc allows this -->
247		<SEQ TYPE="COMMENT3">&lt;&lt;</SEQ>
248		<SEQ TYPE="COMMENT3">&lt;=</SEQ>
249		<SEQ TYPE="COMMENT3">&lt; </SEQ>
250
251		<!-- HTML tags -->
252		<SPAN TYPE="MARKUP" DELEGATE="xml::TAGS"
253			NO_LINE_BREAK="TRUE">
254			<BEGIN>&lt;</BEGIN>
255			<END>&gt;</END>
256		</SPAN>
257
258		<MARK_FOLLOWING TYPE="LABEL">@</MARK_FOLLOWING>
259	</RULES>
260
261</MODE>