Debian Codegraph @

data/syntax/elixir.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language [
3 <!ENTITY symbols "(?:@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?">
4 ]>
5 <!--
6 Elixir syntax highlighting definition for Kate.
7
8 Copyright (C) 2014 by Rubén Caro ([email protected])
9 Copyright (C) 2016 by Boris Egorov ([email protected])
10
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with this library; if not, write to the
21 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.
23 -->
24 <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
25 <language author="Rubén Caro ([email protected]), Boris Egorov ([email protected])"
26 extensions="*.ex;*.exs;*.eex;*.xml.eex;*.js.eex"
27 indenter="elixir"
28 kateversion="5.79"
29 license="LGPLv2+"
30 mimetype="text/x-elixir"
31 name="Elixir"
32 section="Sources"
33 style="elixir"
34 version="14"
35 priority="2">
36 <highlighting>
37 <list name="control-flow">
38 <item>catch</item>
39 <item>cond</item>
40 <item>else</item>
41 <item>if</item>
42 <item>raise</item>
43 <item>rescue</item>
44 <item>throw</item>
45 <item>try</item>
46 <item>unless</item>
47 </list>
48 <list name="keywords">
49 <item>case</item>
50 <item>bc</item>
51 <item>lc</item>
52 <item>for</item>
53 <item>receive</item>
54 <item>exit</item>
55 <item>after</item>
56 <item>quote</item>
57 <item>unquote</item>
58 <item>super</item>
59 <item>and</item>
60 <item>not</item>
61 <item>or</item>
62 <item>when</item>
63 <item>xor</item>
64 <item>in</item>
65 <item>inlist</item>
66 <item>inbits</item>
67 </list>
68 <list name="pseudo-variables">
69 <item>nil</item>
70 <item>true</item>
71 <item>false</item>
72 </list>
73 <list name="definitions">
74 <item>defmodule</item>
75 <item>def</item>
76 <item>defp</item>
77 <item>defprotocol</item>
78 <item>defimpl</item>
79 <item>defrecord</item>
80 <item>defstruct</item>
81 <item>defmacro</item>
82 <item>defmacrop</item>
83 <item>defdelegate</item>
84 <item>defcallback</item>
85 <item>defmacrocallback</item>
86 <item>defexception</item>
87 <item>defoverridable</item>
88 </list>
89 <list name="mixin-macros">
90 <item>import</item>
91 <item>require</item>
92 <item>alias</item>
93 <item>use</item>
94 </list>
95 <contexts>
96 <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
97 <!-- "shebang" line -->
98 <RegExpr String="^#!\/.*" attribute="Keyword" column="0" context="#stay"/>
99
100 <!-- End terminated blocks -->
101 <!-- can be started by do or fn, but not by do: -->
102 <RegExpr String="\bdo\b(?!:)" attribute="Keyword" beginRegion="doend_block"/>
103 <WordDetect String="fn" attribute="Keyword" beginRegion="doend_block"/>
104 <WordDetect String="end" attribute="Keyword" endRegion="doend_block"/>
105
106 <!-- Lists -->
107 <DetectChar char="[" beginRegion="list" attribute="Separator Array"/>
108 <DetectChar char="]" endRegion="list" attribute="Separator Array"/>
109
110 <!-- Maps and Structs and tuples -->
111 <DetectChar char="{" beginRegion="map_or_struct_or_tuple" attribute="Separator Pair"/>
112 <DetectChar char="}" endRegion="map_or_struct_or_tuple" attribute="Separator Pair"/>
113
114 <!-- Function calls and definitions -->
115 <DetectChar char="(" beginRegion="parameters" attribute="Separator Pair"/>
116 <DetectChar char=")" endRegion="parameters" attribute="Separator Pair"/>
117
118
119 <!-- Defined words -->
120 <keyword String="keywords" attribute="Keyword" context="#stay"/>
121 <keyword String="control-flow" attribute="Control Flow" context="#stay"/>
122 <keyword String="definitions" attribute="Definition" context="#stay"/>
123 <keyword String="pseudo-variables" attribute="Pseudo variable" context="#stay"/>
124 <keyword String="mixin-macros" attribute="Mixin macros" context="#stay"/>
125
126 <!-- special-character globals -->
127 <RegExpr String="\b[_A-Z]+[A-Z_0-9]+\b" attribute="Global Constant" context="#stay"/>
128
129 <!-- Generally a module or class name like "File", "MyModule_1", .. -->
130 <RegExpr String="\b[A-Z]+_*(?:[0-9]|[a-z])[_a-zA-Z0-9]*\b" attribute="Constant" context="#stay"/>
131
132 <!-- Numeric values. Note that we have to allow underscores between two digits (thus the creepy regular expressions). -->
133 <RegExpr String="\b\-?0[xX](?:[0-9a-fA-F]|_[0-9a-fA-F])+" attribute="Hex" context="#stay"/>
134 <RegExpr String="\b\-?0[bB](?:[01]|_[01])+" attribute="Bin" context="#stay"/>
135 <RegExpr String="\b\-?0[1-7](?:[0-7]|_[0-7])*" attribute="Octal" context="#stay"/>
136 <RegExpr String="\b\-?[0-9](?:[0-9]|_[0-9])*\.[0-9](?:[0-9]|_[0-9])*(?:[eE]\-?[1-9](?:[0-9]|_[0-9])*(?:\.[0-9]*)?)?" attribute="Float" context="#stay"/>
137 <RegExpr String="\b\-?[1-9](?:[0-9]|_[0-9])*\b" attribute="Dec" context="#stay"/>
138 <Int attribute="Dec" context="#stay"/>
139 <HlCChar attribute="Char" context="#stay"/>
140 <DetectChar attribute="Operator" char="." context="#stay"/>
141 <Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
142 <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
143 <!-- \s!|/=\s is regexp hack -->
144 <RegExpr String="\s[\?\:\%]\s|[|&amp;&lt;&gt;\^\+*~\-=/]+|\s!|/=\s" attribute="Operator" context="#stay"/>
145 <Detect2Chars char="%" char1="=" attribute="Operator" context="#stay"/>
146 <RegExpr String=":&symbols;|\b&symbols;:|:\[\]=?" attribute="Symbol" context="#stay"/>
147 <RegExpr String="@(?:module)?doc\s+&quot;&quot;&quot;" attribute="Attribute" context="Documentation"/>
148 <StringDetect String="&quot;&quot;&quot;" attribute="String" context="Triple Quoted String"/>
149 <DetectChar attribute="String" char="&quot;" context="Quoted String"/>
150 <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
151 <Detect2Chars char="?" char1="#" attribute="Normal Text" context="#stay"/>
152 <DetectChar attribute="Comment" char="#" context="General Comment"/>
153 <RegExpr String="@[a-zA-Z_0-9]+" attribute="Attribute" context="#stay"/>
154 <!-- handle the different regular expression formats -->
155 <DetectIdentifier attribute="Normal Text" context="#stay"/>
156 </context>
157 <context attribute="DocComment" lineEndContext="#stay" name="Documentation">
158 <StringDetect String="&quot;&quot;&quot;" attribute="Attribute" context="#pop"/>
159 <RegExpr attribute="MarkdownHead" String="^\s*#+\s.*[#]?$" column="0"/>
160 <RegExpr attribute="MarkdownBullet" String="^\s*[\*\+\-]\s" column="0"/>
161 <RegExpr attribute="MarkdownNumlist" String="^\s*[\d]+\.\s" column="0"/>
162 <RegExpr attribute="MarkdownCode" context="Markdown Code" String="^\s*\`\`\`\s*$" column="0"/>
163 <DetectSpaces />
164 <IncludeRules context="Normal Text##Markdown"/>
165 </context>
166 <context attribute="String" lineEndContext="#stay" name="Triple Quoted String">
167 <StringDetect String="&quot;&quot;&quot;" attribute="String" context="#pop"/>
168 </context>
169 <context attribute="String" lineEndContext="#stay" name="Quoted String">
170 <Detect2Chars char="\" char1="\" attribute="String" context="#stay"/>
171 <Detect2Chars char="\" char1="&quot;" attribute="String" context="#stay"/>
172 <RegExpr String="#@{1,2}" attribute="Substitution" context="Short Subst"/>
173 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
174 <DetectChar attribute="String" char="&quot;" context="#pop"/>
175 </context>
176 <context attribute="Raw String" lineEndContext="#stay" name="Apostrophed String">
177 <Detect2Chars char="\" char1="\" attribute="String" context="#stay"/>
178 <Detect2Chars char="\" char1="'" attribute="String" context="#stay"/>
179 <DetectChar attribute="Raw String" char="'" context="#pop"/>
180 </context>
181 <!-- Substitutions can be nested -->
182 <context attribute="Normal Text" lineEndContext="#stay" name="Subst">
183 <DetectChar attribute="Substitution" char="}" context="#pop"/>
184 <!-- Highlight substitution as code. -->
185 <IncludeRules context="Normal"/>
186 </context>
187 <context attribute="Substitution" lineEndContext="#pop" name="Short Subst">
188 <!-- Check for e.g.: "#@var#@@xy" -->
189 <RegExpr String="#@{1,2}" attribute="Substitution" context="#stay"/>
190 <RegExpr String="\w(?!\w)" attribute="Substitution" context="#pop"/>
191 </context>
192 <context attribute="Comment" lineEndContext="#pop" name="General Comment">
193 <DetectSpaces />
194 <IncludeRules context="##Comments"/>
195 </context>
196 <context attribute="MarkdownCode" lineEndContext="#stay" name="Markdown Code">
197 <RegExpr String="^\s*```\s*$" attribute="MarkdownCode" context="#pop" column="0"/>
198 </context>
199 </contexts>
200 <itemDatas>
201 <itemData name="Global Constant" defStyleNum="dsConstant"/>
202 <itemData name="Constant" defStyleNum="dsConstant"/>
203 <itemData defStyleNum="dsNormal" name="Normal Text"/>
204 <itemData defStyleNum="dsKeyword" name="Keyword"/>
205 <itemData defStyleNum="dsControlFlow" name="Control Flow"/>
206 <itemData defStyleNum="dsKeyword" name="Definition"/>
207 <itemData defStyleNum="dsImport" name="Mixin macros"/>
208 <itemData defStyleNum="dsConstant" name="Pseudo variable"/>
209 <itemData defStyleNum="dsDecVal" name="Dec"/>
210 <itemData defStyleNum="dsFloat" name="Float"/>
211 <itemData defStyleNum="dsChar" name="Char"/>
212 <itemData defStyleNum="dsBaseN" name="Octal"/>
213 <itemData defStyleNum="dsBaseN" name="Hex"/>
214 <itemData defStyleNum="dsBaseN" name="Bin"/>
215 <itemData defStyleNum="dsVariable" name="Symbol"/>
216 <itemData defStyleNum="dsString" name="String"/>
217 <itemData defStyleNum="dsVerbatimString" name="Raw String"/>
218 <itemData defStyleNum="dsOthers" name="Substitution"/>
219 <itemData defStyleNum="dsOthers" name="Attribute"/>
220 <itemData defStyleNum="dsComment" name="Comment"/>
221 <itemData defStyleNum="dsComment" name="DocComment"/>
222 <itemData defStyleNum="dsFunction" name="Separator Pair"/>
223 <itemData defStyleNum="dsOthers" name="Separator Array"/>
224 <!-- use these to mark errors and alerts things -->
225 <itemData defStyleNum="dsOperator" name="Operator"/>
226 <itemData name="MarkdownHead" defStyleNum="dsFunction" bold="true"/>
227 <itemData name="MarkdownBullet" defStyleNum="dsFunction"/>
228 <itemData name="MarkdownNumlist" defStyleNum="dsFunction"/>
229 <itemData name="MarkdownCode" defStyleNum="dsFunction"/>
230 </itemDatas>
231 </highlighting>
232 <general>
233 <comments>
234 <comment name="singleLine" start="#"/>
235 </comments>
236 <keywords casesensitive="1" weakDeliminator="!?"/>
237 </general>
238 </language>
239 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->