<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
	<!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
	<!ENTITY hex "(?:[0-9a-fA-F]++(_++[0-9a-fA-F]++)*+)">
	<!ENTITY exp "(?:[eE][-+]?&int;)">
	<!ENTITY float "(\b&int;(\.((&int;&exp;?+|&exp;)[fFdD]?\b|[dDfFgG]\b)?|&exp;[fFdD]?\b|[dDfFgG]\b)|\.&int;&exp;?[dDfFgG]?\b)">
	<!ENTITY hexfloat "\b0[xX](&hex;\.?+&hex;?+|\.&hex;?)[pP][-+]?&int;[dDfFgG]?\b">
]>
<!--
    Based on the java syntax file 1.19 by Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)
-->
<language name="Groovy" version="11" kateversion="5.62" section="Sources" extensions="*.groovy;*.gradle;*.gvy;Jenkinsfile" license="LGPL" author="Chris Reeves (chris@ev-soft.net)">
	<highlighting>
		<list name="java15">
			<include>java15##Java</include>
		</list>
		<list name="keywords">
			<item>as</item>
			<item>assert</item>
			<item>class</item>
			<item>default</item>
			<item>enum</item>
			<item>extends</item>
			<item>false</item>
			<item>implements</item>
			<item>import</item>
			<item>in</item>
			<item>instanceof</item>
			<item>native</item>
			<item>abstract</item>
			<item>interface</item>
			<item>new</item>
			<item>null</item>
			<item>package</item>
			<item>super</item>
			<item>this</item>
			<item>throws</item>
			<item>trait</item>
			<item>true</item>
			<item>var</item>
		</list>
		<list name="control flow">
			<item>break</item>
			<item>case</item>
			<item>catch</item>
			<item>continue</item>
			<item>do</item>
			<item>else</item>
			<item>finally</item>
			<item>for</item>
			<item>goto</item>
			<item>if</item>
			<item>return</item>
			<item>switch</item>
			<item>throw</item>
			<item>try</item>
			<item>while</item>
		</list>
		<list name="types">
			<item>def</item>

			<item>boolean</item>
			<item>byte</item>
			<item>char</item>
			<item>double</item>
			<item>float</item>
			<item>int</item>
			<item>long</item>
			<item>short</item>
			<item>void</item>
		</list>
		<contexts>
			<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
				<DetectSpaces context="#stay"/>

				<DetectChar attribute="Symbol" context="Dot" char="." lookAhead="1"/>
				<DetectChar attribute="Symbol" context="AfterSymbol" char="{" beginRegion="Brace1"/>
				<DetectChar attribute="Symbol" context="AfterSymbol" char="}" endRegion="Brace1"/>

				<!-- Comment next line if you don't use Javadoc tool -->
				<IncludeRules context="##Javadoc"/>
				<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
				<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>

				<AnyChar attribute="Symbol" context="AfterSymbol" String="()[]&amp;|+,-/*&lt;=&gt;;!%?:~^"/>

				<AnyChar context="Number" String="0123456789" lookAhead="1"/>

				<DetectChar attribute="String" context="StringSQ" char="'"/>
				<DetectChar attribute="String" context="StringDQ" char="&quot;"/>
				<Detect2Chars attribute="String" context="StringDollarSlashy" char="$" char1="/"/>

				<keyword attribute="Keyword" context="#stay" String="keywords"/>
				<keyword attribute="Control Flow" context="#stay" String="control flow"/>
				<keyword attribute="Data Type" context="#stay" String="types"/>
				<keyword attribute="Java15" context="#stay" String="java15"/>

				<RegExpr attribute="Function" context="#stay" String="\b[_a-zA-Z]\w*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
				<DetectIdentifier attribute="Normal Text"/>
			</context>

			<context attribute="Normal Text" lineEndContext="#stay" name="Dot">
				<IncludeRules context="FindFloat"/>
				<DetectChar attribute="Symbol" context="#pop!Member" char="." />
			</context>
			<context attribute="Normal Text" lineEndContext="#stay" name="Member" fallthroughContext="#pop">
				<DetectSpaces attribute="Normal Text" context="#stay"/>
				<RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[({'&quot;])" />
				<Detect2Chars attribute="Comment" context="#pop!Commentar 1" char="/" char1="/"/>
				<DetectChar attribute="String" context="#pop!StringSlashy" char="/"/>
			</context>

			<context attribute="Normal Text" lineEndContext="#stay" name="AfterSymbol" fallthroughContext="#pop">
				<DetectSpaces attribute="Normal Text" context="#stay"/>
				<Detect2Chars attribute="Comment" context="#pop!Commentar 1" char="/" char1="/"/>
				<DetectChar attribute="String" context="#pop!StringSlashy" char="/"/>
			</context>

			<context attribute="Normal Text" lineEndContext="#stay" name="Number">
				<IncludeRules context="FindFloat"/>
				<RegExpr attribute="Hex" context="#pop" String="\b0[xX]&hex;[lL]?\b"/>
				<RegExpr attribute="Binary" context="#pop" String="\b0[bB][01]++(_++[01]++)*+[gGiIlL]?\b"/>
				<RegExpr attribute="Octal" context="#pop" String="\b0_*+[0-7]++(_++[0-7_]++)*+[gGiIlL]?\b"/>
				<RegExpr attribute="Decimal" context="#pop" String="\b(0|[1-9][0-9]*+(_++[0-9_]++)*+)[gGiIlL]?\b"/>
				<AnyChar attribute="Error" context="#pop" String="0123456789"/>
			</context>
			<context attribute="Normal Text" lineEndContext="#stay" name="FindFloat">
				<RegExpr attribute="Float" context="#pop" String="&float;|&hexfloat;"/>
			</context>

			<context attribute="String" lineEndContext="#pop" name="StringSQ" fallthroughContext="#pop!StringInSQ">
				<Detect2Chars attribute="String" context="#pop!String3SQ" char="'" char1="'"/>
				<DetectChar attribute="String" context="#pop" char="'"/>
			</context>
			<context attribute="String" lineEndContext="#pop" name="StringInSQ">
				<DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
				<DetectChar attribute="String" context="#pop" char="'"/>
			</context>
			<context attribute="String" lineEndContext="#pop!StringIn3SQ" name="String3SQ" fallthroughContext="#pop!StringIn3SQ">
				<LineContinue attribute="Symbol" context="#pop!StringIn3SQ" char="\"/>
			</context>
			<context attribute="String" lineEndContext="#stay" name="StringIn3SQ">
				<DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
				<StringDetect attribute="String" context="#pop" String="'''"/>
			</context>

			<context attribute="String" lineEndContext="#pop" name="StringDQ" fallthroughContext="#pop!StringInDQ">
				<Detect2Chars attribute="String" context="#pop!String3DQ" char="&quot;" char1="&quot;"/>
				<DetectChar attribute="String" context="#pop" char="&quot;"/>
			</context>
			<context attribute="String" lineEndContext="#pop" name="StringInDQ">
				<DetectChar attribute="String Interpolation" context="Interpolation" char="$"/>
				<DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
				<DetectChar attribute="String" context="#pop" char="&quot;"/>
			</context>
			<context attribute="String" lineEndContext="#pop!StringIn3DQ" name="String3DQ" fallthroughContext="#pop!StringIn3DQ">
				<LineContinue attribute="Symbol" context="#pop!StringIn3DQ" char="\"/>
			</context>
			<context attribute="String" lineEndContext="#stay" name="StringIn3DQ">
				<DetectChar attribute="String Interpolation" context="Interpolation" char="$"/>
				<DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
				<StringDetect attribute="String" context="#pop" String="&quot;&quot;&quot;"/>
			</context>

			<context attribute="String" lineEndContext="#stay" name="StringSlashy">
				<DetectChar attribute="String Interpolation" context="Interpolation" char="$"/>
				<DetectChar context="StringSlashyEscapedChar" char="\" lookAhead="1"/>
				<DetectChar attribute="String" context="#pop" char="/"/>
			</context>
			<context attribute="String" lineEndContext="#pop" name="StringSlashyEscapedChar">
				<Detect2Chars attribute="String" context="#pop" char="\" char1="/"/>
				<IncludeRules context="StringEscapedChar"/>
			</context>

			<context attribute="String" lineEndContext="#stay" name="StringDollarSlashy">
				<DetectChar context="InterpolationDollarSlashy" char="$" lookAhead="1"/>
				<Detect2Chars attribute="String" context="#pop" char="/" char1="$"/>
			</context>
			<context attribute="String" lineEndContext="#stay" name="InterpolationDollarSlashy">
				<Detect2Chars attribute="String Interpolation" context="#pop!InInterpolation" char="$" char1="{"/>
				<Detect2Chars attribute="String Char" context="#pop" char="$" char1="$"/>
				<Detect2Chars attribute="String Char" context="#pop" char="$" char1="/"/>
				<RegExpr attribute="String Interpolation" context="#pop!InterpolationIdent" String="\$[_a-zA-Z]\w*" />
				<DetectChar attribute="String" context="#pop" char="$"/>
			</context>

			<context attribute="String" lineEndContext="#stay" name="Interpolation" fallthroughContext="#pop">
				<DetectChar attribute="String Interpolation" context="#pop!InInterpolation" char="{"/>
				<DetectIdentifier attribute="String Interpolation" context="#pop!InterpolationIdent"/>
			</context>
			<context attribute="String Interpolation" lineEndContext="#stay" name="InInterpolation">
				<DetectChar attribute="String Interpolation" context="#pop" char="}"/>
				<IncludeRules context="Normal"/>
			</context>
			<context attribute="String Interpolation" lineEndContext="#pop" name="InterpolationIdent" fallthroughContext="#pop">
				<DetectChar attribute="Symbol" context="InterpolationMember" char="."/>
			</context>
			<context attribute="String Interpolation" lineEndContext="#stay" name="InterpolationMember" fallthroughContext="#pop#pop">
				<DetectIdentifier attribute="String Interpolation" context="#pop"/>
			</context>

			<context attribute="String" lineEndContext="#pop" name="StringEscapedChar">
				<HlCStringChar attribute="String Char" context="#pop"/>
				<RegExpr attribute="String Char" context="#pop" String="\\u[0-9a-fA-F]{4}"/>
				<RegExpr attribute="Error" context="#pop" String="\\(u[0-9a-fA-F]*|.)?"/>
			</context>

			<context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
				<DetectSpaces />
				<IncludeRules context="##Comments"/>
			</context>
			<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
				<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
				<DetectSpaces />
				<IncludeRules context="##Comments"/>
			</context>

		</contexts>
		<itemDatas>
			<itemData name="Normal Text"  defStyleNum="dsNormal"/>
			<itemData name="Keyword"      defStyleNum="dsKeyword"/>
			<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
			<itemData name="Function"     defStyleNum="dsFunction"/>
			<itemData name="Data Type"    defStyleNum="dsDataType"/>
			<itemData name="Decimal"      defStyleNum="dsDecVal" spellChecking="false"/>
			<itemData name="Octal"        defStyleNum="dsBaseN" spellChecking="false"/>
			<itemData name="Hex"          defStyleNum="dsBaseN" spellChecking="false"/>
			<itemData name="Binary"       defStyleNum="dsBaseN" spellChecking="false"/>
			<itemData name="Float"        defStyleNum="dsFloat" spellChecking="false"/>
			<itemData name="String"       defStyleNum="dsString"/>
			<itemData name="String Char"  defStyleNum="dsSpecialChar"/>
			<itemData name="String Interpolation" defStyleNum="dsSpecialString"/>
			<itemData name="Comment"      defStyleNum="dsComment"/>
			<itemData name="Symbol"       defStyleNum="dsOperator"/>
			<itemData name="Java15"       defStyleNum="dsBuiltIn" bold="1" italic="0"/>
			<itemData name="Error"       defStyleNum="dsError" spellChecking="false"/>
		</itemDatas>
	</highlighting>
	<general>
		<comments>
			<comment name="singleLine" start="//"/>
			<comment name="multiLine" start="/*" end="*/" region="Comment"/>
		</comments>
		<keywords casesensitive="1"/>
	</general>
</language>
<!-- kate: replace-tabs off; -->
