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

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language [
0003   <!ENTITY symbols "(?:@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?">
0004 ]>
0005 <!--
0006   Elixir syntax highlighting definition for Kate.
0007 
0008   Copyright (C) 2014  by Rubén Caro (ruben.caro.estevez@gmail.com)
0009   Copyright (C) 2016  by Boris Egorov (egorov@linux.com)
0010 
0011   This library is free software; you can redistribute it and/or
0012   modify it under the terms of the GNU Library General Public
0013   License as published by the Free Software Foundation; either
0014   version 2 of the License, or (at your option) any later version.
0015   This library is distributed in the hope that it will be useful,
0016   but WITHOUT ANY WARRANTY; without even the implied warranty of
0017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018   Library General Public License for more details.
0019   You should have received a copy of the GNU Library General Public
0020   License along with this library; if not, write to the
0021   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022   Boston, MA  02110-1301, USA.
0023 -->
0024 <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
0025 <language author="Rubén Caro (ruben.caro.estevez@gmail.com), Boris Egorov (egorov@linux.com)"
0026           extensions="*.ex;*.exs;*.eex;*.xml.eex;*.js.eex"
0027           indenter="elixir"
0028           kateversion="5.79"
0029           license="LGPLv2+"
0030           mimetype="text/x-elixir"
0031           name="Elixir"
0032           section="Sources"
0033           style="elixir"
0034           version="14"
0035           priority="2">
0036   <highlighting>
0037     <list name="control-flow">
0038       <item>catch</item>
0039       <item>cond</item>
0040       <item>else</item>
0041       <item>if</item>
0042       <item>raise</item>
0043       <item>rescue</item>
0044       <item>throw</item>
0045       <item>try</item>
0046       <item>unless</item>
0047     </list>
0048     <list name="keywords">
0049       <item>case</item>
0050       <item>bc</item>
0051       <item>lc</item>
0052       <item>for</item>
0053       <item>receive</item>
0054       <item>exit</item>
0055       <item>after</item>
0056       <item>quote</item>
0057       <item>unquote</item>
0058       <item>super</item>
0059       <item>and</item>
0060       <item>not</item>
0061       <item>or</item>
0062       <item>when</item>
0063       <item>xor</item>
0064       <item>in</item>
0065       <item>inlist</item>
0066       <item>inbits</item>
0067     </list>
0068     <list name="pseudo-variables">
0069       <item>nil</item>
0070       <item>true</item>
0071       <item>false</item>
0072     </list>
0073     <list name="definitions">
0074       <item>defmodule</item>
0075       <item>def</item>
0076       <item>defp</item>
0077       <item>defprotocol</item>
0078       <item>defimpl</item>
0079       <item>defrecord</item>
0080       <item>defstruct</item>
0081       <item>defmacro</item>
0082       <item>defmacrop</item>
0083       <item>defdelegate</item>
0084       <item>defcallback</item>
0085       <item>defmacrocallback</item>
0086       <item>defexception</item>
0087       <item>defoverridable</item>
0088     </list>
0089     <list name="mixin-macros">
0090       <item>import</item>
0091       <item>require</item>
0092       <item>alias</item>
0093       <item>use</item>
0094     </list>
0095     <contexts>
0096       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
0097         <!-- "shebang" line -->
0098         <RegExpr String="^#!\/.*" attribute="Keyword" column="0" context="#stay"/>
0099 
0100         <!-- End terminated blocks -->
0101         <!-- can be started by do or fn, but not by do: -->
0102         <RegExpr String="\bdo\b(?!:)" attribute="Keyword" beginRegion="doend_block"/>
0103         <WordDetect String="fn" attribute="Keyword" beginRegion="doend_block"/>
0104         <WordDetect String="end" attribute="Keyword" endRegion="doend_block"/>
0105 
0106         <!-- Lists -->
0107         <DetectChar char="[" beginRegion="list" attribute="Separator Array"/>
0108         <DetectChar char="]" endRegion="list" attribute="Separator Array"/>
0109 
0110         <!-- Maps and Structs and tuples -->
0111         <DetectChar char="{" beginRegion="map_or_struct_or_tuple" attribute="Separator Pair"/>
0112         <DetectChar char="}" endRegion="map_or_struct_or_tuple" attribute="Separator Pair"/>
0113 
0114         <!-- Function calls and definitions -->
0115         <DetectChar char="(" beginRegion="parameters" attribute="Separator Pair"/>
0116         <DetectChar char=")" endRegion="parameters" attribute="Separator Pair"/>
0117 
0118 
0119         <!-- Defined words -->
0120         <keyword String="keywords" attribute="Keyword" context="#stay"/>
0121         <keyword String="control-flow" attribute="Control Flow" context="#stay"/>
0122         <keyword String="definitions" attribute="Definition" context="#stay"/>
0123         <keyword String="pseudo-variables" attribute="Pseudo variable" context="#stay"/>
0124         <keyword String="mixin-macros" attribute="Mixin macros" context="#stay"/>
0125 
0126         <!-- special-character globals -->
0127         <RegExpr String="\b[_A-Z]+[A-Z_0-9]+\b" attribute="Global Constant" context="#stay"/>
0128 
0129         <!-- Generally a module or class name like "File", "MyModule_1", .. -->
0130         <RegExpr String="\b[A-Z]+_*(?:[0-9]|[a-z])[_a-zA-Z0-9]*\b" attribute="Constant" context="#stay"/>
0131 
0132         <!-- Numeric values. Note that we have to allow underscores between two digits (thus the creepy regular expressions). -->
0133         <RegExpr String="\b\-?0[xX](?:[0-9a-fA-F]|_[0-9a-fA-F])+" attribute="Hex" context="#stay"/>
0134         <RegExpr String="\b\-?0[bB](?:[01]|_[01])+" attribute="Bin" context="#stay"/>
0135         <RegExpr String="\b\-?0[1-7](?:[0-7]|_[0-7])*" attribute="Octal" context="#stay"/>
0136         <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"/>
0137         <RegExpr String="\b\-?[1-9](?:[0-9]|_[0-9])*\b" attribute="Dec" context="#stay"/>
0138         <Int attribute="Dec" context="#stay"/>
0139         <HlCChar attribute="Char" context="#stay"/>
0140         <DetectChar attribute="Operator" char="." context="#stay"/>
0141         <Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
0142         <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
0143         <!-- \s!|/=\s is regexp hack -->
0144         <RegExpr String="\s[\?\:\%]\s|[|&amp;&lt;&gt;\^\+*~\-=/]+|\s!|/=\s" attribute="Operator" context="#stay"/>
0145         <Detect2Chars char="%" char1="=" attribute="Operator" context="#stay"/>
0146         <RegExpr String=":&symbols;|\b&symbols;:|:\[\]=?" attribute="Symbol" context="#stay"/>
0147         <RegExpr String="@(?:module)?doc\s+&quot;&quot;&quot;" attribute="Attribute" context="Documentation"/>
0148         <StringDetect String="&quot;&quot;&quot;" attribute="String" context="Triple Quoted String"/>
0149         <DetectChar attribute="String" char="&quot;" context="Quoted String"/>
0150         <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
0151         <Detect2Chars char="?" char1="#" attribute="Normal Text" context="#stay"/>
0152         <DetectChar attribute="Comment" char="#" context="General Comment"/>
0153         <RegExpr String="@[a-zA-Z_0-9]+" attribute="Attribute" context="#stay"/>
0154         <!-- handle the different regular expression formats -->
0155         <DetectIdentifier attribute="Normal Text" context="#stay"/>
0156       </context>
0157       <context attribute="DocComment" lineEndContext="#stay" name="Documentation">
0158         <StringDetect String="&quot;&quot;&quot;" attribute="Attribute" context="#pop"/>
0159         <RegExpr attribute="MarkdownHead" String="^\s*#+\s.*[#]?$" column="0"/>
0160         <RegExpr attribute="MarkdownBullet" String="^\s*[\*\+\-]\s" column="0"/>
0161         <RegExpr attribute="MarkdownNumlist" String="^\s*[\d]+\.\s" column="0"/>
0162         <RegExpr attribute="MarkdownCode" context="Markdown Code" String="^\s*\`\`\`\s*$" column="0"/>
0163         <DetectSpaces />
0164         <IncludeRules context="Normal Text##Markdown"/>
0165       </context>
0166       <context attribute="String" lineEndContext="#stay" name="Triple Quoted String">
0167         <StringDetect String="&quot;&quot;&quot;" attribute="String" context="#pop"/>
0168       </context>
0169       <context attribute="String" lineEndContext="#stay" name="Quoted String">
0170         <Detect2Chars char="\" char1="\" attribute="String" context="#stay"/>
0171         <Detect2Chars char="\" char1="&quot;" attribute="String" context="#stay"/>
0172         <RegExpr String="#@{1,2}" attribute="Substitution" context="Short Subst"/>
0173         <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0174         <DetectChar attribute="String" char="&quot;" context="#pop"/>
0175       </context>
0176       <context attribute="Raw String" lineEndContext="#stay" name="Apostrophed String">
0177         <Detect2Chars char="\" char1="\" attribute="String" context="#stay"/>
0178         <Detect2Chars char="\" char1="'" attribute="String" context="#stay"/>
0179         <DetectChar attribute="Raw String" char="'" context="#pop"/>
0180       </context>
0181       <!-- Substitutions can be nested -->
0182       <context attribute="Normal Text" lineEndContext="#stay" name="Subst">
0183         <DetectChar attribute="Substitution" char="}" context="#pop"/>
0184         <!-- Highlight substitution as code. -->
0185         <IncludeRules context="Normal"/>
0186       </context>
0187       <context attribute="Substitution" lineEndContext="#pop" name="Short Subst">
0188         <!-- Check for e.g.: "#@var#@@xy" -->
0189         <RegExpr String="#@{1,2}" attribute="Substitution" context="#stay"/>
0190         <RegExpr String="\w(?!\w)" attribute="Substitution" context="#pop"/>
0191       </context>
0192       <context attribute="Comment" lineEndContext="#pop" name="General Comment">
0193         <DetectSpaces />
0194         <IncludeRules context="##Comments"/>
0195       </context>
0196       <context attribute="MarkdownCode" lineEndContext="#stay" name="Markdown Code">
0197         <RegExpr String="^\s*```\s*$" attribute="MarkdownCode" context="#pop" column="0"/>
0198       </context>
0199     </contexts>
0200     <itemDatas>
0201       <itemData name="Global Constant" defStyleNum="dsConstant"/>
0202       <itemData name="Constant" defStyleNum="dsConstant"/>
0203       <itemData defStyleNum="dsNormal" name="Normal Text"/>
0204       <itemData defStyleNum="dsKeyword" name="Keyword"/>
0205       <itemData defStyleNum="dsControlFlow" name="Control Flow"/>
0206       <itemData defStyleNum="dsKeyword" name="Definition"/>
0207       <itemData defStyleNum="dsImport" name="Mixin macros"/>
0208       <itemData defStyleNum="dsConstant" name="Pseudo variable"/>
0209       <itemData defStyleNum="dsDecVal" name="Dec"/>
0210       <itemData defStyleNum="dsFloat" name="Float"/>
0211       <itemData defStyleNum="dsChar" name="Char"/>
0212       <itemData defStyleNum="dsBaseN" name="Octal"/>
0213       <itemData defStyleNum="dsBaseN" name="Hex"/>
0214       <itemData defStyleNum="dsBaseN" name="Bin"/>
0215       <itemData defStyleNum="dsVariable" name="Symbol"/>
0216       <itemData defStyleNum="dsString" name="String"/>
0217       <itemData defStyleNum="dsVerbatimString" name="Raw String"/>
0218       <itemData defStyleNum="dsOthers" name="Substitution"/>
0219       <itemData defStyleNum="dsOthers" name="Attribute"/>
0220       <itemData defStyleNum="dsComment" name="Comment"/>
0221       <itemData defStyleNum="dsComment" name="DocComment"/>
0222       <itemData defStyleNum="dsFunction" name="Separator Pair"/>
0223       <itemData defStyleNum="dsOthers" name="Separator Array"/>
0224       <!-- use these to mark errors and alerts things -->
0225       <itemData defStyleNum="dsOperator" name="Operator"/>
0226       <itemData name="MarkdownHead" defStyleNum="dsFunction" bold="true"/>
0227       <itemData name="MarkdownBullet" defStyleNum="dsFunction"/>
0228       <itemData name="MarkdownNumlist" defStyleNum="dsFunction"/>
0229       <itemData name="MarkdownCode" defStyleNum="dsFunction"/>
0230     </itemDatas>
0231   </highlighting>
0232   <general>
0233     <comments>
0234       <comment name="singleLine" start="#"/>
0235     </comments>
0236     <keywords casesensitive="1" weakDeliminator="!?"/>
0237   </general>
0238 </language>
0239 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->