Warning, /frameworks/syntax-highlighting/data/syntax/go.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language [
0003   <!ENTITY hex "[0-9a-fA-F]">
0004   <!ENTITY int "(?:[0-9](?:_?[0-9]++)*+)">
0005   <!ENTITY hex_int "(?:[0-9A-Fa-f](?:_?[0-9A-Fa-f]++)*+)">
0006   <!ENTITY exp_float "(?:[eE][+-]?&int;)">
0007   <!ENTITY exp_hexfloat "(?:[pP][-+]?&int;)">
0008 ]>
0009 
0010 <!--
0011 This file is part of KDE's Kate project
0012 
0013 GO.XML supports syntax highlighting for the Go programming language
0014 under Kate. Go is a compiled, garbage-collected, concurrent programming
0015 language developed by Google Inc.
0016 
0017 Copyright (C) 2010, Miquel Sabaté <mikisabate@gmail.com>
0018 
0019 This program, including associated files, is free software.  You may
0020 distribute it and/or modify it under the terms of the GNU General Public
0021 License as published by the Free Software Foundation; either Version 2 of
0022 the license, or (at your option) any later version.
0023 
0024 This program is distributed in the hope that it will be useful, but
0025 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0026 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0027 for more details.
0028 
0029 You should have received a copy of the GNU General Public License along
0030 with this program; if not, write to the Free Software Foundation, Inc.,
0031 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0032 -->
0033 
0034 <language name="Go" version="10" kateversion="5.79" section="Sources" indenter="cstyle" extensions="*.go" author="Miquel Sabaté (mikisabate@gmail.com)" license="GPLv2+">
0035   <!-- https://go.dev/ref/spec -->
0036   <highlighting>
0037 
0038     <!-- https://go.dev/ref/spec#Keywords -->
0039     <list name="keywords">
0040       <item>chan</item>
0041       <item>const</item>
0042       <item>func</item>
0043       <item>import</item>
0044       <item>interface</item>
0045       <item>map</item>
0046       <item>package</item>
0047       <item>range</item>
0048       <item>struct</item>
0049       <item>type</item>
0050       <item>var</item>
0051     </list>
0052     <list name="controlflow">
0053       <item>break</item>
0054       <item>case</item>
0055       <item>continue</item>
0056       <item>default</item>
0057       <item>defer</item>
0058       <item>else</item>
0059       <item>fallthrough</item>
0060       <item>for</item>
0061       <item>go</item>
0062       <item>goto</item>
0063       <item>if</item>
0064       <item>return</item>
0065       <item>select</item>
0066       <item>switch</item>
0067     </list>
0068 
0069     <!-- https://go.dev/ref/spec#Types -->
0070     <list name="types">
0071       <item>bool</item>
0072       <item>byte</item>
0073       <item>complex64</item>
0074       <item>complex128</item>
0075       <item>error</item>
0076       <item>float32</item>
0077       <item>float64</item>
0078       <item>int</item>
0079       <item>int8</item>
0080       <item>int16</item>
0081       <item>int32</item>
0082       <item>int64</item>
0083       <item>rune</item>
0084       <item>string</item>
0085       <item>uint</item>
0086       <item>uintptr</item>
0087       <item>uint8</item>
0088       <item>uint16</item>
0089       <item>uint32</item>
0090       <item>uint64</item>
0091       <!-- Go 1.18 -->
0092       <item>any</item>
0093       <item>comparable</item>
0094     </list>
0095 
0096     <list name="builtin">
0097       <item>append</item>
0098       <item>cap</item>
0099       <item>close</item>
0100       <item>complex</item>
0101       <item>copy</item>
0102       <item>delete</item>
0103       <item>imag</item>
0104       <item>len</item>
0105       <item>make</item>
0106       <item>new</item>
0107       <item>panic</item>
0108       <item>print</item>
0109       <item>println</item>
0110       <item>real</item>
0111       <item>recover</item>
0112     </list>
0113 
0114     <list name="predeclared">
0115       <item>false</item>
0116       <item>nil</item>
0117       <item>true</item>
0118       <item>iota</item>
0119     </list>
0120 
0121     <contexts>
0122       <context name="normal" attribute="Normal Text" lineEndContext="#stay">
0123         <DetectSpaces />
0124         <keyword attribute="Keyword" context="#stay" String="keywords" />
0125         <keyword attribute="Control Flow" context="#stay" String="controlflow" />
0126         <keyword attribute="Predeclared Identifier" context="#stay" String="predeclared" />
0127         <keyword attribute="Data Type" context="#stay" String="types" />
0128         <keyword attribute="Builtin Function" context="#stay" String="builtin" />
0129         <DetectIdentifier />
0130         <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
0131         <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"   />
0132         <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"   />
0133         <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment" />
0134         <RegExpr context="Number" String="\.?[0-9]" lookAhead="true" />
0135         <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^;"/>
0136         <DetectChar attribute="String" context="String" char="&quot;" />
0137         <DetectChar attribute="Char" context="Char" char="'" />
0138         <DetectChar attribute="String" context="Multiline String" char="`"/>
0139       </context>
0140 
0141       <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
0142         <DetectSpaces />
0143         <IncludeRules context="##Comments" />
0144         <DetectIdentifier />
0145       </context>
0146 
0147       <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
0148         <DetectSpaces />
0149         <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
0150         <IncludeRules context="##Comments" />
0151         <DetectIdentifier />
0152       </context>
0153 
0154       <!-- https://go.dev/ref/spec#Integer_literals -->
0155       <!-- https://go.dev/ref/spec#Floating-point_literals -->
0156       <context attribute="Normal Text" lineEndContext="#pop" name="Number">
0157         <WordDetect attribute="Decimal" context="NumberSuffix" String="0" weakDeliminator="."/>
0158         <RegExpr attribute="Float" context="NumberSuffix" String="\.&int;&exp_float;?|0[xX](?:\.&hex_int;&exp_hexfloat;?|_?&hex_int;(?:&exp_hexfloat;|\.&hex_int;?&exp_hexfloat;?))|&int;(?:&exp_float;|\.&int;?&exp_float;?)" />
0159         <DetectChar context="#pop!IntStartsWith0" char="0" lookAhead="1"/>
0160         <RegExpr attribute="Decimal" context="NumberSuffix" String="&int;" />
0161       </context>
0162       <context name="IntStartsWith0" attribute="Normal Text" lineEndContext="#pop">
0163         <RegExpr attribute="Hex" context="NumberSuffix" String="0[xX](?:_?[0-9A-Fa-f]++)*+" />
0164         <RegExpr attribute="Binary" context="NumberSuffix" String="0[Bb](?:_?[01]++)*+" />
0165         <RegExpr attribute="Octal" context="NumberSuffix" String="0[Oo]?(?:_?[0-7]++)*+" />
0166         <DetectChar attribute="Decimal" context="NumberSuffix" char="0"/>
0167       </context>
0168 
0169       <context name="NumberSuffix" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="NumericSuffixError">
0170         <DetectChar attribute="Suffix" context="NumericSuffixError" char="i" />
0171         <DetectChar attribute="Error" context="#stay" char="_" />
0172       </context>
0173       <context name="NumericSuffixError" attribute="Error" lineEndContext="#pop#pop#pop" fallthroughContext="#pop#pop#pop">
0174         <RegExpr attribute="Error" context="#pop#pop#pop" String="[._0-9A-Za-z]+" />
0175       </context>
0176 
0177       <!-- https://go.dev/ref/spec#String_literals -->
0178       <context attribute="String" lineEndContext="#pop" name="String">
0179         <DetectChar attribute="String" context="#pop" char="&quot;" />
0180         <IncludeRules context="FindEscape" />
0181       </context>
0182 
0183       <context attribute="String" lineEndContext="#pop" name="FindEscape">
0184         <DetectChar context="EscapedChar" char="\" lookAhead="1"/>
0185       </context>
0186       <context attribute="String" lineEndContext="#pop" name="EscapedChar">
0187         <RegExpr attribute="String Char" context="#pop" String="\\[abfnrtv\\'&quot;]|\\x&hex;{2}|\\u&hex;{4}|\\U&hex;{8}|\\[0-3][0-7]{2}" />
0188         <RegExpr attribute="Error" context="#pop" String="\\[xuU]&hex;*|\\[0-7]{1,3}|\\" />
0189       </context>
0190 
0191       <context attribute="String" lineEndContext="#stay" name="Multiline String">
0192         <DetectChar attribute="String" context="#pop" char="`"/>
0193       </context>
0194 
0195       <context attribute="Char" lineEndContext="#pop" name="Char">
0196         <DetectChar attribute="Char" context="#pop" char="'" />
0197         <IncludeRules context="FindEscape" />
0198       </context>
0199 
0200     </contexts>
0201 
0202     <itemDatas>
0203       <itemData name="Normal Text"  defStyleNum="dsNormal"   spellChecking="false"/>
0204       <itemData name="Keyword"      defStyleNum="dsKeyword"  spellChecking="false"/>
0205       <itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
0206       <itemData name="Predeclared Identifier" defStyleNum="dsOthers"  spellChecking="false" />
0207       <itemData name="Builtin Function"       defStyleNum="dsBuiltIn" spellChecking="false" />
0208       <itemData name="Data Type"    defStyleNum="dsDataType" spellChecking="false"/>
0209       <itemData name="String Char"  defStyleNum="dsChar"     spellChecking="false"/>
0210       <itemData name="String"       defStyleNum="dsString"  />
0211       <itemData name="Comment"      defStyleNum="dsComment" />
0212       <itemData name="Decimal"      defStyleNum="dsDecVal"   spellChecking="false"/>
0213       <itemData name="Binary"       defStyleNum="dsBaseN"    spellChecking="false"/>
0214       <itemData name="Octal"        defStyleNum="dsBaseN"    spellChecking="false"/>
0215       <itemData name="Hex"          defStyleNum="dsBaseN"    spellChecking="false"/>
0216       <itemData name="Float"        defStyleNum="dsFloat"    spellChecking="false"/>
0217       <itemData name="Suffix"       defStyleNum="dsBuiltIn"  spellChecking="false"/>
0218       <itemData name="Char"         defStyleNum="dsChar"     spellChecking="false"/>
0219       <itemData name="Symbol"       defStyleNum="dsOperator" spellChecking="false"/>
0220       <itemData name="Error"        defStyleNum="dsError"    spellChecking="false"/>
0221     </itemDatas>
0222     </highlighting>
0223   <general>
0224     <comments>
0225       <comment name="singleLine" start="//" position="afterwhitespace" />
0226       <comment name="multiLine" start="/*" end="*/" region="Comment"/>
0227     </comments>
0228     <keywords casesensitive="1" additionalDeliminator="'&quot;" />
0229   </general>
0230 </language>
0231 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->