Warning, /frameworks/syntax-highlighting/data/syntax/erlang.xml is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?> 0002 <!DOCTYPE language 0003 [ 0004 <!ENTITY atomstr "\b[a-z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)" > 0005 <!ENTITY varstr "\b[_A-Z][_a-z@-Z0-9]*(?:(?=[^_a-z@-Z0-9])|$)" > 0006 <!-- pragmas defined here, because "keyword" can't handle the leading '-' --> 0007 <!ENTITY pragmas 0008 "^(?:-module|-export|-define|-undef|-ifdef|-ifndef|-else|-endif|-include|-include_lib)" > 0009 <!-- same with separators: (from s3.9 p 24 of erlang spec) --> 0010 <!ENTITY separators "(?:\(|\)|\{|\}|\[|\]|\.|\:|\||\|\||;|\,|\?|->|\#)" > 0011 <!-- and operators - although words are dealt with separately --> 0012 <!ENTITY opsymbols 0013 "(?:\+|-|\*|\/|==|\/=|=:=|=\/=|<|=<|>|>=|\+\+|--|=|!|<-)" > 0014 ] 0015 > 0016 <!-- 0017 Copyright (C) 2007 Bill Ross <bill@emailme.net.au> 0018 0019 0020 This library is free software; you can redistribute it and/or 0021 modify it under the terms of the GNU Library General Public 0022 License version 2 as published by the Free Software Foundation. 0023 0024 This library is distributed in the hope that it will be useful, 0025 but WITHOUT ANY WARRANTY; without even the implied warranty of 0026 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0027 Library General Public License for more details. 0028 0029 You should have received a copy of the GNU Library General Public License 0030 along with this library; see the file COPYING.LIB. If not, write to 0031 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0032 Boston, MA 02110-1301, USA. 0033 0034 Changes 0035 v1-0-2 (2008-01-10) - fixed to '_" in atom and variable names (thanks to Vito De Tullio) 0036 - fixed highlighting problem when '@' at end of atom/variable 0037 --> 0038 0039 <language name="Erlang" version="6" kateversion="5.0" section="Scripts" extensions="*.erl" mimetype="" author="Bill Ross (bill@emailme.net.au)" license="LGPLv2"> 0040 <highlighting> 0041 <list name="keywords"> 0042 <!-- ====== s3.8 p 24 of erlang spec ===== --> 0043 <item>after</item> 0044 <item>begin</item> 0045 <item>case</item> 0046 <item>catch</item> 0047 <item>cond</item> 0048 <item>end</item> 0049 <item>fun</item> 0050 <item>if</item> 0051 <item>let</item> 0052 <item>of</item> 0053 <item>query</item> 0054 <item>receive</item> 0055 <item>all_true</item> 0056 <item>some_true</item> 0057 </list> 0058 <list name="operators"> 0059 <!-- operators: s3.9 p 24 of erlang spec --> 0060 <!-- see also opsymbols for the symbols --> 0061 <item>div</item> 0062 <item>rem</item> 0063 <item>or</item> 0064 <item>xor</item> 0065 <item>bor</item> 0066 <item>bxor</item> 0067 <item>bsl</item> 0068 <item>bsr</item> 0069 <item>and</item> 0070 <item>band</item> 0071 <item>not</item> 0072 <item>bnot</item> 0073 </list> 0074 <list name="functions"> 0075 <!-- all standard (erlang) functions are here, --> 0076 <!-- except those defined as erlang:function (those will show as functions anyway --> 0077 <item>abs</item> 0078 <item>accept</item> 0079 <item>alarm</item> 0080 <item>apply</item> 0081 <item>atom_to_list</item> 0082 <item>binary_to_list</item> 0083 <item>binary_to_term</item> 0084 <item>check_process_code</item> 0085 <item>concat_binary</item> 0086 <item>date</item> 0087 <item>delete_module</item> 0088 <item>disconnect_node</item> 0089 <item>element</item> 0090 <item>erase</item> 0091 <item>exit</item> 0092 <item>float</item> 0093 <item>float_to_list</item> 0094 <item>garbage_collect</item> 0095 <item>get</item> 0096 <item>get_keys</item> 0097 <item>group_leader</item> 0098 <item>halt</item> 0099 <item>hd</item> 0100 <item>integer_to_list</item> 0101 <item>is_alive</item> 0102 <item>is_atom</item> 0103 <item>is_binary</item> 0104 <item>is_boolean</item> 0105 <item>is_float</item> 0106 <item>is_function</item> 0107 <item>is_integer</item> 0108 <item>is_list</item> 0109 <item>is_number</item> 0110 <item>is_pid</item> 0111 <item>is_port</item> 0112 <item>is_process_alive</item> 0113 <item>is_record</item> 0114 <item>is_reference</item> 0115 <item>is_tuple</item> 0116 <item>length</item> 0117 <item>link</item> 0118 <item>list_to_atom</item> 0119 <item>list_to_binary</item> 0120 <item>list_to_float</item> 0121 <item>list_to_integer</item> 0122 <item>list_to_pid</item> 0123 <item>list_to_tuple</item> 0124 <item>load_module</item> 0125 <item>loaded</item> 0126 <item>localtime</item> 0127 <item>make_ref</item> 0128 <item>module_loaded</item> 0129 <item>node</item> 0130 <item>nodes</item> 0131 <item>now</item> 0132 <item>open_port</item> 0133 <item>pid_to_list</item> 0134 <item>port_close</item> 0135 <item>port_command</item> 0136 <item>port_connect</item> 0137 <item>port_control</item> 0138 <item>ports</item> 0139 <item>pre_loaded</item> 0140 <item>process_flag</item> 0141 <item>process_info</item> 0142 <item>processes</item> 0143 <item>purge_module</item> 0144 <item>put</item> 0145 <item>register</item> 0146 <item>registered</item> 0147 <item>round</item> 0148 <item>self</item> 0149 <item>setelement</item> 0150 <item>size</item> 0151 <item>spawn</item> 0152 <item>spawn_link</item> 0153 <item>spawn_opt</item> 0154 <item>split_binary</item> 0155 <item>statistics</item> 0156 <item>term_to_binary</item> 0157 <item>throw</item> 0158 <item>time</item> 0159 <item>tl</item> 0160 <item>trunc</item> 0161 <item>tuple_to_list</item> 0162 <item>unlink</item> 0163 <item>unregister</item> 0164 <item>whereis</item> 0165 </list> 0166 <contexts> 0167 <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text" > 0168 <RegExpr attribute="Pragma" context="#stay" column="0" String="&pragmas;" /> 0169 <keyword attribute="Keyword" context="#stay" String="keywords" /> 0170 <keyword attribute="Operator" context="#stay" String="operators" /> 0171 <RegExpr attribute="Operator" context="#stay" String="&opsymbols;" /> 0172 <keyword attribute="Function" context="#stay" String="functions" /> 0173 <RegExpr attribute="Separator" context="#stay" String="&separators;" /> 0174 <DetectSpaces /> 0175 <DetectChar attribute="Comment" context="comment" char="%" /> 0176 0177 <!-- Functions (in addition to named functions dealt with above) --> 0178 <!-- simple version - got to be in form module:function --> 0179 <RegExpr attribute="Function" context="#stay" String="&atomstr;:&atomstr;" /> 0180 <RegExpr attribute="Function" context="isfunction" String="&atomstr;\(" lookAhead="true" /> 0181 0182 <!-- Variables - begin with upper case, or between single quotes --> 0183 <RegExpr attribute="Variable" context="#stay" String="&varstr;" /> 0184 0185 <!-- atoms - begin with lower case (letters, numbers, @), 0186 or anything between single quotes --> 0187 <DetectChar attribute="Atom" context="atomquote" char="'" /> 0188 <RegExpr attribute="Atom" context="#stay" String="&atomstr;" /> 0189 0190 <DetectChar attribute="String" context="stringquote" char=""" /> 0191 0192 <!-- numbers - these work --> 0193 <!-- integers have three forms 7, 3#22, $A --> 0194 <!-- float must have a number after the decimal point, or it doesn't count --> 0195 <RegExpr attribute="Float" context="#stay" String="[0-9]+\.[0-9]+(?:[eE][+-]?[0-9]+)?" /> 0196 <RegExpr attribute="Number" context="#stay" String="\d+#[a-zA-Z0-9]+" /> 0197 <RegExpr attribute="Integer" context="#stay" String="\$\S|[0-9]+" /> 0198 0199 </context> 0200 0201 <!-- isfunction --> 0202 <!-- confirm that this is a function and capture name for formatting --> 0203 <!-- lookahead for '(' already performed by the time we are here --> 0204 <context name="isfunction" attribute="Function" lineEndContext="#pop" > 0205 <RegExpr attribute="Function" context="#pop" String="&atomstr;" /> 0206 </context> 0207 0208 <!-- finish off the atom in quoted string (allow for escaped single quotes --> 0209 <context name="atomquote" attribute="Atom" lineEndContext="#pop"> 0210 <RegExpr attribute="Atom" context="#pop" String="(?:(?:\\')?[^']*)*'" /> 0211 </context> 0212 0213 <!-- finish off the atom in quoted string (allow for escaped single quotes --> 0214 <context name="stringquote" attribute="String" lineEndContext="#pop"> 0215 <RegExpr attribute="String" context="#pop" String="(?:(?:\\")?[^"]*)*"" /> 0216 </context> 0217 0218 <!-- finish off the comment (allows for alerts) --> 0219 <context name="comment" attribute="Comment" lineEndContext="#pop"> 0220 <DetectSpaces /> 0221 <IncludeRules context="##Comments" /> 0222 <DetectIdentifier /> 0223 </context> 0224 0225 </contexts> 0226 <itemDatas> 0227 <itemData name="Normal Text" defStyleNum="dsNormal" /> 0228 <itemData name="Keyword" defStyleNum="dsKeyword" /> 0229 <itemData name="Pragma" defStyleNum="dsKeyword" /> 0230 <itemData name="Function" defStyleNum="dsFunction" /> 0231 <itemData name="Separator" defStyleNum="dsFunction" /> 0232 <itemData name="Operator" defStyleNum="dsOperator" /> 0233 <itemData name="Variable" defStyleNum="dsVariable" /> 0234 <itemData name="Integer" defStyleNum="dsDecVal" /> 0235 <itemData name="Number" defStyleNum="dsBaseN" /> 0236 <itemData name="Float" defStyleNum="dsFloat" /> 0237 <itemData name="Atom" defStyleNum="dsChar" /> 0238 <itemData name="String" defStyleNum="dsString" /> 0239 <itemData name="Comment" defStyleNum="dsComment" /> 0240 </itemDatas> 0241 </highlighting> 0242 <general> 0243 <comments> 0244 <comment name="singleLine" start="%" /> 0245 </comments> 0246 <keywords casesensitive="1" /> 0247 </general> 0248 </language> 0249 <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->