Warning, /frameworks/syntax-highlighting/data/syntax/ruby.xml is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003
0004 <!--
0005 Ruby syntax highlighting definition for Kate.
0006
0007 Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi)
0008 Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at)
0009 Copyright (C) 2008 by Robin Pedersen (robinpeder@gmail.com)
0010 Copyright (C) 2011 by Miquel Sabaté (mikisabate@gmail.com)
0011
0012 This library is free software; you can redistribute it and/or
0013 modify it under the terms of the GNU Library General Public
0014 License as published by the Free Software Foundation; either
0015 version 2 of the License, or (at your option) any later version.
0016
0017 This library is distributed in the hope that it will be useful,
0018 but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0020 Library General Public License for more details.
0021
0022 You should have received a copy of the GNU Library General Public
0023 License along with this library; if not, write to the
0024 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0025 Boston, MA 02110-1301, USA.
0026 -->
0027
0028 <!--
0029 TODO: Division after gdl contexts is interpreted as regexp
0030 -->
0031
0032 <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
0033 <language name="Ruby" section="Scripts"
0034 version="18" kateversion="5.0"
0035 extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile"
0036 mimetype="application/x-ruby"
0037 style="ruby" indenter="ruby"
0038 author="Stefan Lang (langstefan@gmx.at), Sebastian Vuorinen (sebastian.vuorinen@helsinki.fi), Robin Pedersen (robinpeder@gmail.com), Miquel Sabaté (mikisabate@gmail.com)" license="LGPLv2+">
0039
0040 <highlighting>
0041
0042 <list name="keywords">
0043 <item>BEGIN</item>
0044 <item>END</item>
0045 <item>and</item>
0046 <item>begin</item>
0047 <item>break</item>
0048 <item>case</item>
0049 <item>defined?</item>
0050 <item>do</item>
0051 <item>else</item>
0052 <item>elsif</item>
0053 <item>end</item>
0054 <item>ensure</item>
0055 <item>for</item>
0056 <item>if</item>
0057 <item>in</item>
0058 <item>next</item>
0059 <item>not</item>
0060 <item>or</item>
0061 <item>redo</item>
0062 <item>rescue</item>
0063 <item>retry</item>
0064 <item>return</item>
0065 <item>then</item>
0066 <item>unless</item>
0067 <item>until</item>
0068 <item>when</item>
0069 <item>yield</item>
0070 </list>
0071
0072 <list name="access-control">
0073 <item>private_class_method</item>
0074 <item>private</item>
0075 <item>protected</item>
0076 <item>public_class_method</item>
0077 <item>public</item>
0078 </list>
0079
0080 <list name="attribute-definitions">
0081 <item>attr_reader</item>
0082 <item>attr_writer</item>
0083 <item>attr_accessor</item>
0084 </list>
0085
0086 <list name="definitions">
0087 <item>alias</item>
0088 <item>module</item>
0089 <item>class</item>
0090 <item>def</item>
0091 <item>undef</item>
0092 </list>
0093
0094 <list name="pseudo-variables">
0095 <item>self</item>
0096 <item>super</item>
0097 <item>nil</item>
0098 <item>false</item>
0099 <item>true</item>
0100 <item>caller</item>
0101 <item>__FILE__</item>
0102 <item>__LINE__</item>
0103 </list>
0104
0105 <list name="default-globals">
0106 <item>$stdout</item>
0107 <item>$defout</item>
0108 <item>$stderr</item>
0109 <item>$deferr</item>
0110 <item>$stdin</item>
0111 </list>
0112
0113 <!-- Kernel module methods.
0114 NOTE: Methods ending in ? or !
0115 are included below as regexes.
0116 -->
0117 <list name="kernel-methods">
0118 <!-- backquote ` -->
0119 <item>abort</item>
0120 <item>at_exit</item>
0121 <item>autoload</item>
0122 <item>autoload?</item>
0123 <item>binding</item>
0124 <item>block_given?</item>
0125 <item>callcc</item>
0126 <item>caller</item>
0127 <item>catch</item>
0128 <item>chomp</item>
0129 <item>chomp!</item>
0130 <item>chop</item>
0131 <item>chop!</item>
0132 <item>eval</item>
0133 <item>exec</item>
0134 <item>exit</item>
0135 <item>exit!</item>
0136 <item>fail</item>
0137 <item>fork</item>
0138 <item>format</item>
0139 <item>getc</item>
0140 <item>gets</item>
0141 <item>global_variables</item>
0142 <item>gsub</item>
0143 <item>gsub!</item>
0144 <item>iterator?</item>
0145 <item>lambda</item>
0146 <item>load</item>
0147 <item>local_variables</item>
0148 <item>loop</item>
0149 <item>method_missing</item>
0150 <item>open</item>
0151 <item>p</item>
0152 <item>print</item>
0153 <item>printf</item>
0154 <item>proc</item>
0155 <item>putc</item>
0156 <item>puts</item>
0157 <item>raise</item>
0158 <item>rand</item>
0159 <item>readline</item>
0160 <item>readlines</item>
0161 <item>require</item>
0162 <item>require_relative</item>
0163 <item>scan</item>
0164 <item>select</item>
0165 <item>set_trace_func</item>
0166 <item>sleep</item>
0167 <item>split</item>
0168 <item>sprintf</item>
0169 <item>srand</item>
0170 <item>sub</item>
0171 <item>sub!</item>
0172 <item>syscall</item>
0173 <item>system</item>
0174 <item>test</item>
0175 <item>throw</item>
0176 <item>trace_var</item>
0177 <item>trap</item>
0178 <item>untrace_var</item>
0179 <item>warn</item>
0180 </list>
0181
0182 <list name="mixin-methods">
0183 <item>extend</item>
0184 <item>include</item>
0185 <item>prepend</item>
0186 <item>refine</item>
0187 <item>using</item>
0188 </list>
0189
0190 <contexts>
0191 <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
0192 <!-- ruby ignores newline after \ -->
0193 <LineContinue attribute="Normal Text" context="Line Continue"/>
0194
0195 <!-- __END__ token on own line. -->
0196 <RegExpr attribute="Keyword" String="^__END__$" context="DATA" column="0"/>
0197
0198 <!-- "shebang" line -->
0199 <RegExpr attribute="Keyword" String="^#!\/.*" context="#stay" column="0"/>
0200
0201 <!-- "def" - "end" blocks -->
0202 <!-- check for statement modifiers with regexes -->
0203 <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/>
0204 <DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
0205 <RegExpr attribute="Keyword" String="[=([]\s*(if|unless|while|until)\b|(while|until)\b(?!.*\bdo\b)|\;\s*(while|until)\b(?!.*\bdo\b)|\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
0206 <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
0207 <WordDetect attribute="Keyword" String="class" context="no_heredoc" beginRegion="def block"/>
0208 <WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/>
0209 <WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/>
0210 <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
0211 <WordDetect attribute="Keyword" String="case" context="#stay" beginRegion="def block"/>
0212 <WordDetect attribute="Keyword" String="do" context="#stay" beginRegion="def block"/>
0213 <WordDetect attribute="Keyword" String="def" context="#stay" beginRegion="def block"/>
0214 <WordDetect attribute="Keyword" String="end" context="#stay" endRegion="def block"/>
0215 <!-- elsif/else close the current block and start a new one -->
0216 <RegExpr attribute="Keyword" String="\b(else|elsif|rescue|ensure)\b" context="#stay" endRegion="def block" beginRegion="def block"/>
0217
0218 <StringDetect attribute="Operator" String="..." context="#stay"/>
0219 <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
0220
0221 <!-- marks a message (being sent, not defined) -->
0222 <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="check_div_2"/>
0223
0224 <!-- Check for "ASCII code operator". e.g.: ?a -->
0225 <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="check_div_1"/>
0226
0227 <keyword attribute="Keyword" String="keywords" context="#stay"/>
0228 <keyword attribute="Attribute Definition" String="attribute-definitions" context="check_div_2"/>
0229 <keyword attribute="Access Control" String="access-control" context="check_div_2"/>
0230 <keyword attribute="Definition" String="definitions" context="#stay" />
0231 <keyword attribute="Pseudo variable" String="pseudo-variables" context="check_div_1"/>
0232 <keyword attribute="Default globals" String="default-globals" context="check_div_2"/>
0233 <keyword attribute="Kernel methods" String="kernel-methods" context="check_div_2"/>
0234 <keyword attribute="Module mixin methods" String="mixin-methods" context="check_div_2"/>
0235
0236 <!-- (global) vars starting with $
0237 Match them before $_.
0238 -->
0239 <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+|\$\-[a-zA-Z_]\b" context="check_div_1"/>
0240 <!-- special-character globals -->
0241 <RegExpr attribute="Default globals" String="\$[\d_*`+@;,.~=\!\$:?'/\\\-\&"><]" context="check_div_1"/>
0242 <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="check_div_2"/>
0243 <!-- Generally a module or class name like "File", "MyModule_1", .. -->
0244 <RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="check_div_2"/>
0245
0246 <!-- Numeric values. Note that we have to allow underscores between two digits (thus the creepy regular expressions). -->
0247 <RegExpr attribute="Hex" String="\b\-?0[xX]([0-9a-fA-F]|_[0-9a-fA-F])+" context="check_div_1"/>
0248 <RegExpr attribute="Bin" String="\b\-?0[bB]([01]|_[01])+" context="check_div_1"/>
0249 <RegExpr attribute="Octal" String="\b\-?0[1-7]([0-7]|_[0-7])*" context="check_div_1"/>
0250 <RegExpr attribute="Float" String="\b\-?[0-9]([0-9]|_[0-9])*\.[0-9]([0-9]|_[0-9])*([eE]\-?[1-9]([0-9]|_[0-9])*(\.[0-9]*)?)?" context="check_div_1"/>
0251 <RegExpr attribute="Dec" String="\b\-?[1-9]([0-9]|_[0-9])*\b" context="check_div_1"/>
0252 <Int attribute="Dec" context="check_div_1"/>
0253 <HlCChar attribute="Char" context="check_div_1"/>
0254
0255 <!-- Check for =begin before assignment operator. -->
0256 <RegExpr attribute="Blockcomment" String="^=begin(?:\s|$)" context="Embedded documentation" beginRegion="comment block" column="0"/>
0257
0258 <!-- recognize the beginning of a HEREDOC
0259 This uses new features in Kate 2.3 and later
0260
0261 There is no other chance of keeping heredoc apart from the
0262 push operator '<<' than requiring to put space between the operator
0263 and the string.
0264 -->
0265 <RegExpr attribute="Operator" context="find_indented_heredoc" String="\s*<<[-~](?=\w+|["'`])" beginRegion="HereDocument" />
0266 <RegExpr attribute="Operator" context="find_heredoc" String="\s*<<(?=\w+|["'`])" beginRegion="HereDocument" />
0267
0268 <DetectChar attribute="Operator" char="." context="#stay"/>
0269 <Detect2Chars attribute="Operator" char="&" char1="&" context="#stay"/>
0270 <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
0271 <!-- \s! is regexp hack -->
0272 <RegExpr attribute="Operator" String="\s[\?\:\%]\s|[|&<>\^\+*~\-=]+|\s!|/=\s" context="#stay"/>
0273 <Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/>
0274 <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
0275
0276 <RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?|:\[\]=?" context="check_div_1"/>
0277
0278 <!-- Do not send to "check_div_1" context!:
0279 after detecting these rules (": ") there can be a regular expression (see bug: #361875) -->
0280 <RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: |\[\]=?: " context="#stay"/>
0281
0282 <DetectChar attribute="String" char=""" context="Quoted String"/>
0283 <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
0284 <DetectChar attribute="Command" char="`" context="Command String"/>
0285
0286 <Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/>
0287
0288 <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
0289 <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
0290 <DetectChar attribute="Comment" char="#" context="General Comment"/>
0291
0292 <DetectChar attribute="Delimiter" char="[" context="#stay"/>
0293 <DetectChar attribute="Delimiter" char="]" context="check_div_1"/>
0294
0295 <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="check_div_1"/>
0296 <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="check_div_1"/>
0297
0298 <!-- handle the different regular expression formats -->
0299 <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/>
0300
0301 <!-- recognize the beginning of a general delimited input format -->
0302 <!-- this moves to the next context to separate out the exact nature of the GDL input -->
0303 <RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[QqxwW]?[^\s])" beginRegion="GdlInput" />
0304
0305 <DetectChar attribute="Normal Text" char=")" context="check_div_1"/>
0306 <DetectIdentifier attribute="Normal Text" context="check_div_2"/>
0307
0308 </context>
0309
0310 <!-- In the following contexts, a slash character ('/') is a division operator -->
0311 <!-- Everywhere else, it's a regular expression delimiter -->
0312
0313 <!-- A slash is always a division operator, even if preceeded by whitespace -->
0314 <context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
0315 <DetectSpaces attribute="Normal Text" context="#stay"/>
0316 <AnyChar attribute="Operator" String="/%" context="#pop"/>
0317 </context>
0318
0319 <!-- Same as check_div_1, but with double pop to exit the surrounding context -->
0320 <context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
0321 <DetectSpaces attribute="Normal Text" context="#stay"/>
0322 <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
0323 </context>
0324
0325 <!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace -->
0326 <context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
0327 <AnyChar attribute="Operator" String="/%" context="#pop"/>
0328 <DetectSpaces attribute="Normal Text" context="check_div_2_internal"/>
0329 </context>
0330
0331 <!-- Internal context used by check_div_2 -->
0332 <context name="check_div_2_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
0333 <!-- <DetectChar attribute="Operator" char="%" context="#pop#pop"/> -->
0334 <RegExpr attribute="Operator" String="[/%](?=\s)" context="#pop#pop"/>
0335 </context>
0336
0337 <!-- Same as check_div_2, but with double pop to exit the surrounding context -->
0338 <context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
0339 <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
0340 <DetectSpaces attribute="Normal Text" context="check_div_2_pop_internal"/>
0341 </context>
0342
0343 <!-- Internal context used by check_div_2_pop -->
0344 <context name="check_div_2_pop_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop#pop" lineEndContext="#pop#pop#pop">
0345 <DetectChar attribute="Operator" char="%" context="#pop#pop#pop"/>
0346 <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop#pop"/>
0347 </context>
0348
0349 <context name="Line Continue" attribute="Normal Text" lineEndContext="#pop">
0350 <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)|(if|unless)\b" context="#stay" firstNonSpace="true"/>
0351 <IncludeRules context="Normal"/>
0352 </context>
0353
0354 <context name="Find closing block brace" attribute="Normal Text" lineEndContext="#stay">
0355 <DetectChar attribute="Operator" char="}" context="check_div_1_pop" endRegion="def block"/>
0356 <IncludeRules context="Normal"/>
0357 </context>
0358
0359 <context name="Quoted String" attribute="String" lineEndContext="#stay">
0360 <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0361 <Detect2Chars attribute="String" char="\" char1=""" context="#stay"/>
0362 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0363 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0364 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0365 <DetectChar char=""" attribute="String" context="check_div_1_pop"/>
0366 </context>
0367
0368 <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay">
0369 <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0370 <Detect2Chars attribute="String" char="\" char1="'" context="#stay"/>
0371 <DetectChar char="'" attribute="Raw String" context="check_div_1_pop"/>
0372 </context>
0373
0374 <context name="Command String" attribute="Command" lineEndContext="#stay">
0375 <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0376 <Detect2Chars attribute="String" char="\" char1="`" context="#stay"/>
0377 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0378 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0379 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0380 <DetectChar char="`" attribute="Command" context="check_div_1_pop"/>
0381 </context>
0382
0383 <context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay">
0384 <RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/>
0385 <DetectSpaces />
0386 <IncludeRules context="##Comments" />
0387 </context>
0388
0389 <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
0390 <Detect2Chars attribute="Regular Expression" char="\" char1="/" context="#stay"/>
0391 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0392 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0393 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0394 <RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="check_div_1_pop"/>
0395 </context>
0396
0397 <!-- Substitutions can be nested -->
0398 <context name="Subst" attribute="Normal Text" lineEndContext="#stay">
0399 <DetectChar attribute="Substitution" char="}" context="#pop"/>
0400 <!-- Highlight substitution as code. -->
0401 <IncludeRules context="Normal"/>
0402 </context>
0403
0404 <context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
0405 <!-- Check for e.g.: "#@var#@@xy" -->
0406 <RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/>
0407 <Detect2Chars attribute="Substitution" char="#" char1="$" context="#stay"/>
0408 <RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
0409 </context>
0410
0411 <!-- This handles access of nested module classes and class methods -->
0412 <context name="Member Access" attribute="Member" lineEndContext="#pop">
0413 <!-- marks a message (being sent, not defined) -->
0414 <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?(?=[^\w\d\.\:])" context="check_div_2_pop"/>
0415 <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?" context="#stay"/>
0416 <RegExpr attribute="Constant" String="[A-Z]+_*(\d|[a-z])\w*(?=[^\w\d\.\:])" context="check_div_2_pop"/>
0417 <RegExpr attribute="Constant" String="[A-Z]+_*([0-9]|[a-z])\w*" context="#stay"/>
0418 <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" context="check_div_2_pop"/>
0419 <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" context="#stay"/>
0420 <Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/>
0421 <DetectChar attribute="Member" char="." context="#stay"/>
0422
0423 <AnyChar attribute="Operator" String="=+-*/%|&[]{}~" context="#pop"/>
0424 <DetectChar attribute="Comment" char="#" context="#pop"/>
0425 <AnyChar attribute="Normal Text" String="()\" context="#pop"/>
0426 <RegExpr attribute="Member" String="\W" context="#pop"/>
0427 </context>
0428
0429 <context name="General Comment" attribute="Comment" lineEndContext="#pop">
0430 <DetectSpaces />
0431 <IncludeRules context="##Comments" />
0432 </context>
0433
0434 <!-- HEREDOC support
0435 The contexts below support both normal and indented heredocs
0436 -->
0437 <!-- here we markup the heredoc markers -->
0438 <context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0439 <RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
0440 <RegExpr attribute="Keyword" context="normal_heredoc" String="(?|(\w+)|"(\w+)"|`(\w+)`)" />
0441 </context>
0442 <context name="find_indented_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0443 <RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
0444 <RegExpr attribute="Keyword" context="indented_heredoc" String="(?|(\w+)|"(\w+)"|`(\w+)`)" />
0445 </context>
0446 <!-- these are the real heredoc contexts -->
0447 <context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
0448 <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
0449 <IncludeRules context="heredoc_rules" />
0450 </context>
0451 <context name="apostrophed_indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
0452 <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
0453 </context>
0454
0455 <context name="normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
0456 <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
0457 <IncludeRules context="heredoc_rules" />
0458 </context>
0459 <context name="apostrophed_normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
0460 <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
0461 </context>
0462
0463 <!-- rules for heredoc types -->
0464 <context name="heredoc_rules" attribute="Normal Text" lineEndContext="#stay">
0465 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0466 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0467 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0468 </context>
0469
0470 <!-- avoid highlighting heredoc markers, for example, in singleton class definition (see bug: #358273) -->
0471 <context name="no_heredoc" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0472 <DetectSpaces />
0473 <Detect2Chars attribute="Operator" char="<" char1="<" context="#pop"/>
0474 <!-- comments -->
0475 <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
0476 <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
0477 <DetectChar attribute="Comment" char="#" context="General Comment"/>
0478 </context>
0479
0480 <!-- General delimited input support
0481 The contexts below handle the various gdl formats
0482 -->
0483 <context name="find_gdl_input" attribute="Normal Text" lineEndContext="#pop">
0484
0485 <!-- handle token arrays -->
0486 <Detect2Chars attribute="GDL input" context="gdl_token_array_1" char="w" char1="(" />
0487 <Detect2Chars attribute="GDL input" context="gdl_token_array_2" char="w" char1="{" />
0488 <Detect2Chars attribute="GDL input" context="gdl_token_array_3" char="w" char1="[" />
0489 <Detect2Chars attribute="GDL input" context="gdl_token_array_4" char="w" char1="<" />
0490 <!-- then we handle the 'any char' format -->
0491 <RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" />
0492
0493 <!-- handle token arrays -->
0494 <Detect2Chars attribute="GDL input" context="gdl_token_array_1" char="W" char1="(" />
0495 <Detect2Chars attribute="GDL input" context="gdl_token_array_2" char="W" char1="{" />
0496 <Detect2Chars attribute="GDL input" context="gdl_token_array_3" char="W" char1="[" />
0497 <Detect2Chars attribute="GDL input" context="gdl_token_array_4" char="W" char1="<" />
0498 <!-- then we handle the 'any char' format -->
0499 <RegExpr attribute="GDL input" context="gdl_token_array_5" String="W([^\s\w])" />
0500
0501 <!-- handle apostrophed strings -->
0502 <Detect2Chars attribute="GDL input" context="gdl_apostrophed_1" char="q" char1="(" />
0503 <Detect2Chars attribute="GDL input" context="gdl_apostrophed_2" char="q" char1="{" />
0504 <Detect2Chars attribute="GDL input" context="gdl_apostrophed_3" char="q" char1="[" />
0505 <Detect2Chars attribute="GDL input" context="gdl_apostrophed_4" char="q" char1="<" />
0506 <!-- then we handle the 'any char' format -->
0507 <RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" />
0508
0509 <!-- handle shell commands -->
0510 <Detect2Chars attribute="GDL input" context="gdl_shell_command_1" char="x" char1="(" />
0511 <Detect2Chars attribute="GDL input" context="gdl_shell_command_2" char="x" char1="{" />
0512 <Detect2Chars attribute="GDL input" context="gdl_shell_command_3" char="x" char1="[" />
0513 <Detect2Chars attribute="GDL input" context="gdl_shell_command_4" char="x" char1="<" />
0514 <!-- then we handle the 'any char' format -->
0515 <RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" />
0516
0517 <!-- handle regular expressions -->
0518 <Detect2Chars attribute="GDL input" context="gdl_regexpr_1" char="r" char1="(" />
0519 <Detect2Chars attribute="GDL input" context="gdl_regexpr_2" char="r" char1="{" />
0520 <Detect2Chars attribute="GDL input" context="gdl_regexpr_3" char="r" char1="[" />
0521 <Detect2Chars attribute="GDL input" context="gdl_regexpr_4" char="r" char1="<" />
0522 <!-- then we handle the 'any char' format -->
0523 <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" />
0524
0525 <!-- handle double-quoted strings -->
0526 <!--
0527 be careful to make this the last GDL ruleset, because the rule for
0528 the short form %?foo? will otherwise catch any of the other formats
0529 -->
0530 <Detect2Chars attribute="GDL input" context="gdl_dq_string_1" char="Q" char1="(" />
0531 <Detect2Chars attribute="GDL input" context="gdl_dq_string_2" char="Q" char1="{" />
0532 <Detect2Chars attribute="GDL input" context="gdl_dq_string_3" char="Q" char1="[" />
0533 <Detect2Chars attribute="GDL input" context="gdl_dq_string_4" char="Q" char1="<" />
0534 <DetectChar attribute="GDL input" context="gdl_dq_string_1" char="(" />
0535 <DetectChar attribute="GDL input" context="gdl_dq_string_2" char="{" />
0536 <DetectChar attribute="GDL input" context="gdl_dq_string_3" char="[" />
0537 <DetectChar attribute="GDL input" context="gdl_dq_string_4" char="<" />
0538 <!-- then we handle the 'any char' format -->
0539 <RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" />
0540
0541 </context>
0542 <!-- double-quoted string specific contexts follow -->
0543 <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" >
0544 <IncludeRules context="dq_string_rules" />
0545 <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
0546 <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
0547 <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
0548 </context>
0549 <context name="gdl_dq_string_1_nested" attribute="String" lineEndContext="#stay" >
0550 <IncludeRules context="dq_string_rules" />
0551 <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
0552 <DetectChar attribute="String" context="#pop" char=")" />
0553 </context>
0554 <!-- note that here substitution should win over nesting -->
0555 <context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" >
0556 <IncludeRules context="dq_string_rules" />
0557 <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
0558 <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
0559 <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
0560 </context>
0561 <context name="gdl_dq_string_2_nested" attribute="String" lineEndContext="#stay" >
0562 <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
0563 <DetectChar attribute="String" context="#pop" char="}" />
0564 <IncludeRules context="dq_string_rules" />
0565 </context>
0566
0567 <context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" >
0568 <IncludeRules context="dq_string_rules" />
0569 <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
0570 <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
0571 <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
0572 </context>
0573 <context name="gdl_dq_string_3_nested" attribute="String" lineEndContext="#stay" >
0574 <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
0575 <DetectChar attribute="String" context="#pop" char="]" />
0576 <IncludeRules context="dq_string_rules" />
0577 </context>
0578
0579 <context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" >
0580 <IncludeRules context="dq_string_rules" />
0581 <Detect2Chars attribute="String" char="\" char1=">" context="#stay"/>
0582 <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" />
0583 <DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" />
0584 </context>
0585 <context name="gdl_dq_string_4_nested" attribute="String" lineEndContext="#stay" >
0586 <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" />
0587 <DetectChar attribute="String" context="#pop" char=">" />
0588 <IncludeRules context="dq_string_rules" />
0589 </context>
0590
0591 <!-- this format doesn't allow nesting. it is terminated by the next occurrence of the
0592 delimiter character
0593 -->
0594 <context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
0595 <IncludeRules context="dq_string_rules" />
0596 <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true" />
0597 <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
0598 </context>
0599 <!-- rules to be included in all dq_string contexts -->
0600 <context name="dq_string_rules" attribute="String" lineEndContext="#stay" >
0601 <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0602 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0603 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0604 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0605 </context>
0606
0607 <!-- token array specific contexts -->
0608
0609 <context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" >
0610 <IncludeRules context="token_array_rules" />
0611 <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
0612 <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
0613 <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
0614 </context>
0615 <context name="gdl_token_array_1_nested" attribute="String" lineEndContext="#stay" >
0616 <IncludeRules context="token_array_rules" />
0617 <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
0618 <DetectChar attribute="String" context="#pop" char=")" />
0619 </context>
0620
0621 <context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" >
0622 <IncludeRules context="token_array_rules" />
0623 <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
0624 <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
0625 <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
0626 </context>
0627 <context name="gdl_token_array_2_nested" attribute="String" lineEndContext="#stay" >
0628 <IncludeRules context="token_array_rules" />
0629 <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
0630 <DetectChar attribute="String" context="#pop" char="}" />
0631 </context>
0632
0633 <context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" >
0634 <IncludeRules context="token_array_rules" />
0635 <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
0636 <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
0637 <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
0638 </context>
0639 <context name="gdl_token_array_3_nested" attribute="String" lineEndContext="#stay" >
0640 <IncludeRules context="token_array_rules" />
0641 <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
0642 <DetectChar attribute="String" context="#pop" char="]" />
0643 </context>
0644
0645 <context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" >
0646 <IncludeRules context="token_array_rules" />
0647 <Detect2Chars attribute="String" char="\" char1=">" context="#stay"/>
0648 <DetectChar attribute="String" context="gdl_token_array_4_nested" char="<" />
0649 <DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" />
0650 </context>
0651 <context name="gdl_token_array_4_nested" attribute="String" lineEndContext="#stay" >
0652 <IncludeRules context="token_array_rules" />
0653 <DetectChar attribute="String" context="gdl_token_array_4_nested" char="<" />
0654 <DetectChar attribute="String" context="#pop" char=">" />
0655 </context>
0656
0657 <!-- this format doesn't allow nesting. it is terminated by the next occurrence of the
0658 delimiter character
0659 -->
0660 <context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
0661 <IncludeRules context="token_array_rules" />
0662 <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true"/>
0663 <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
0664 </context>
0665
0666 <!-- rules to be included in all token_array contexts -->
0667 <context name="token_array_rules" attribute="String" lineEndContext="#stay" >
0668 <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
0669 </context>
0670
0671 <!-- apostrophed string specific contexts -->
0672
0673 <context name="gdl_apostrophed_1" attribute="Raw String" lineEndContext="#stay" >
0674 <IncludeRules context="apostrophed_rules" />
0675 <Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/>
0676 <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
0677 <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
0678 </context>
0679 <context name="gdl_apostrophed_1_nested" attribute="Raw String" lineEndContext="#stay" >
0680 <IncludeRules context="apostrophed_rules" />
0681 <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
0682 <DetectChar attribute="Raw String" context="#pop" char=")" />
0683 </context>
0684
0685 <context name="gdl_apostrophed_2" attribute="Raw String" lineEndContext="#stay" >
0686 <IncludeRules context="apostrophed_rules" />
0687 <Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/>
0688 <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
0689 <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
0690 </context>
0691 <context name="gdl_apostrophed_2_nested" attribute="Raw String" lineEndContext="#stay" >
0692 <IncludeRules context="apostrophed_rules" />
0693 <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
0694 <DetectChar attribute="Raw String" context="#pop" char="}" />
0695 </context>
0696
0697 <context name="gdl_apostrophed_3" attribute="Raw String" lineEndContext="#stay" >
0698 <IncludeRules context="apostrophed_rules" />
0699 <Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/>
0700 <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
0701 <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
0702 </context>
0703 <context name="gdl_apostrophed_3_nested" attribute="Raw String" lineEndContext="#stay" >
0704 <IncludeRules context="apostrophed_rules" />
0705 <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
0706 <DetectChar attribute="Raw String" context="#pop" char="]" />
0707 </context>
0708
0709 <context name="gdl_apostrophed_4" attribute="Raw String" lineEndContext="#stay" >
0710 <IncludeRules context="apostrophed_rules" />
0711 <Detect2Chars attribute="Raw String" char="\" char1=">" context="#stay"/>
0712 <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="<" />
0713 <DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" />
0714 </context>
0715 <context name="gdl_apostrophed_4_nested" attribute="Raw String" lineEndContext="#stay" >
0716 <IncludeRules context="apostrophed_rules" />
0717 <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="<" />
0718 <DetectChar attribute="Raw String" context="#pop" char=">" />
0719 </context>
0720
0721 <!-- this format doesn't allow nesting. it is terminated by the next occurrence of the
0722 delimiter character
0723 -->
0724 <context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
0725 <IncludeRules context="apostrophed_rules" />
0726 <StringDetect attribute="Raw String" String="\%1" context="#stay" dynamic="true"/>
0727 <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
0728 </context>
0729
0730 <!-- rules to be included in all apostrophed contexts -->
0731 <context name="apostrophed_rules" attribute="Raw String" lineEndContext="#stay" >
0732 <Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/>
0733 </context>
0734
0735 <!-- shell command specific contexts -->
0736
0737 <context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" >
0738 <IncludeRules context="shell_command_rules" />
0739 <Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/>
0740 <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
0741 <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
0742 </context>
0743 <context name="gdl_shell_command_1_nested" attribute="Command" lineEndContext="#stay" >
0744 <IncludeRules context="shell_command_rules" />
0745 <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
0746 <DetectChar attribute="Command" context="#pop" char=")" />
0747 </context>
0748
0749 <context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" >
0750 <IncludeRules context="shell_command_rules" />
0751 <Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/>
0752 <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
0753 <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
0754 </context>
0755 <context name="gdl_shell_command_2_nested" attribute="Command" lineEndContext="#stay" >
0756 <IncludeRules context="shell_command_rules" />
0757 <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
0758 <DetectChar attribute="Command" context="#pop" char="}" />
0759 </context>
0760
0761 <context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" >
0762 <IncludeRules context="shell_command_rules" />
0763 <Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/>
0764 <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
0765 <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
0766 </context>
0767 <context name="gdl_shell_command_3_nested" attribute="Command" lineEndContext="#stay" >
0768 <IncludeRules context="shell_command_rules" />
0769 <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
0770 <DetectChar attribute="Command" context="#pop" char="]" />
0771 </context>
0772
0773 <context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" >
0774 <IncludeRules context="shell_command_rules" />
0775 <Detect2Chars attribute="Command" char="\" char1=">" context="#stay"/>
0776 <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="<" />
0777 <DetectChar attribute="GDL input" context="#pop#pop" char=">" endRegion="GdlInput" />
0778 </context>
0779 <context name="gdl_shell_command_4_nested" attribute="Command" lineEndContext="#stay" >
0780 <IncludeRules context="shell_command_rules" />
0781 <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="<" />
0782 <DetectChar attribute="Command" context="#pop" char=">" />
0783 </context>
0784
0785 <!-- this format doesn't allow nesting. it is terminated by the next occurrence of the
0786 delimiter character
0787 -->
0788 <context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
0789 <IncludeRules context="shell_command_rules" />
0790 <StringDetect attribute="Command" String="\%1" context="#stay" dynamic="true" />
0791 <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
0792 </context>
0793
0794 <!-- rules to be included in all shell_command contexts -->
0795 <context name="shell_command_rules" attribute="Command" lineEndContext="#stay" >
0796 <Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/>
0797 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0798 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0799 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0800 </context>
0801
0802 <!-- regular expression specific contexts -->
0803
0804 <context name="gdl_regexpr_1" attribute="Regular Expression" lineEndContext="#stay" >
0805 <IncludeRules context="regexpr_rules" />
0806 <Detect2Chars attribute="Regular Expression" char="\" char1=")" context="#stay"/>
0807 <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
0808 <RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" endRegion="GdlInput" />
0809 </context>
0810 <context name="gdl_regexpr_1_nested" attribute="Regular Expression" lineEndContext="#stay" >
0811 <IncludeRules context="regexpr_rules" />
0812 <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
0813 <DetectChar attribute="Regular Expression" context="#pop" char=")" />
0814 </context>
0815
0816 <context name="gdl_regexpr_2" attribute="Regular Expression" lineEndContext="#stay" >
0817 <IncludeRules context="regexpr_rules" />
0818 <Detect2Chars attribute="Regular Expression" char="\" char1="}" context="#stay"/>
0819 <RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" endRegion="GdlInput" />
0820 <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
0821 </context>
0822 <context name="gdl_regexpr_2_nested" attribute="Regular Expression" lineEndContext="#stay" >
0823 <IncludeRules context="regexpr_rules" />
0824 <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
0825 <DetectChar attribute="Regular Expression" context="#pop" char="}" />
0826 </context>
0827
0828 <context name="gdl_regexpr_3" attribute="Regular Expression" lineEndContext="#stay" >
0829 <IncludeRules context="regexpr_rules" />
0830 <Detect2Chars attribute="Regular Expression" char="\" char1="]" context="#stay"/>
0831 <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
0832 <RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" endRegion="GdlInput" />
0833 </context>
0834 <context name="gdl_regexpr_3_nested" attribute="Regular Expression" lineEndContext="#stay" >
0835 <IncludeRules context="regexpr_rules" />
0836 <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
0837 <DetectChar attribute="Regular Expression" context="#pop" char="]" />
0838 </context>
0839
0840 <context name="gdl_regexpr_4" attribute="Regular Expression" lineEndContext="#stay" >
0841 <IncludeRules context="regexpr_rules" />
0842 <Detect2Chars attribute="Regular Expression" char="\" char1=">" context="#stay"/>
0843 <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="<" />
0844 <RegExpr attribute="GDL input" context="#pop#pop" String=">[uiomxn]*" endRegion="GdlInput" />
0845 </context>
0846 <context name="gdl_regexpr_4_nested" attribute="Regular Expression" lineEndContext="#stay" >
0847 <IncludeRules context="regexpr_rules" />
0848 <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="<" />
0849 <DetectChar attribute="Regular Expression" context="#pop" char=">" />
0850 </context>
0851
0852 <!-- this format doesn't allow nesting. it is terminated by the next occurrence of the
0853 delimiter character
0854 -->
0855 <context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
0856 <IncludeRules context="regexpr_rules" />
0857 <StringDetect attribute="Regular Expression" String="\%1" context="#stay" dynamic="true" />
0858 <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
0859 </context>
0860
0861 <!-- rules to be included in all regexpr contexts -->
0862 <context name="regexpr_rules" attribute="Regular Expression" lineEndContext="#stay" >
0863 <Detect2Chars attribute="Regular Expression" char="\" char1="\" context="#stay"/>
0864 <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
0865 <Detect2Chars attribute="Substitution" char="#" char1="$" context="Short Subst"/>
0866 <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
0867 </context>
0868
0869 <!-- END of General delimited input support -->
0870
0871 <!-- handle data in script -->
0872 <context name="DATA" attribute="Data" lineEndContext="#stay"/>
0873 </contexts>
0874
0875 <itemDatas>
0876 <itemData name="Normal Text" defStyleNum="dsNormal"/>
0877
0878 <itemData name="Keyword" defStyleNum="dsControlFlow"/>
0879 <itemData name="Attribute Definition" defStyleNum="dsOthers"/>
0880 <itemData name="Access Control" defStyleNum="dsAttribute" bold="1"/> <!-- #0000FF -->
0881 <itemData name="Definition" defStyleNum="dsKeyword"/>
0882 <itemData name="Pseudo variable" defStyleNum="dsDecVal"/>
0883
0884 <itemData name="Dec" defStyleNum="dsDecVal"/>
0885 <itemData name="Float" defStyleNum="dsFloat"/>
0886 <itemData name="Char" defStyleNum="dsChar"/>
0887 <itemData name="Octal" defStyleNum="dsBaseN"/>
0888 <itemData name="Hex" defStyleNum="dsBaseN"/>
0889 <itemData name="Bin" defStyleNum="dsBaseN"/>
0890
0891 <itemData name="Symbol" defStyleNum="dsWarning" bold="0" underline="0"/> <!-- #D40000 -->
0892 <itemData name="String" defStyleNum="dsString"/>
0893 <itemData name="Raw String" defStyleNum="dsVerbatimString" /> <!-- #DD4A4A -->
0894 <itemData name="Command" defStyleNum="dsInformation"/> <!-- #AA3000 -->
0895 <itemData name="Message" defStyleNum="dsAttribute" bold="0"/> <!-- #4000A7 -->
0896 <itemData name="Regular Expression" defStyleNum="dsSpecialString"/> <!-- #4A5704 -->
0897 <itemData name="Substitution" defStyleNum="dsSpecialChar"/>
0898 <itemData name="Data" defStyleNum="dsNormal"/>
0899 <!-- short for 'general delimited input' -->
0900 <itemData name="GDL input" defStyleNum="dsOthers" />
0901
0902 <itemData name="Default globals" defStyleNum="dsVariable" bold="1"/> <!-- #C00000 -->
0903 <itemData name="Global Variable" defStyleNum="dsVariable"/> <!-- #C00000 -->
0904 <itemData name="Global Constant" defStyleNum="dsConstant" bold="1"/> <!-- #bb1188 -->
0905 <itemData name="Constant" defStyleNum="dsDataType"/>
0906 <itemData name="Constant Value" defStyleNum="dsConstant" bold="0"/> <!-- #bb1188 -->
0907 <itemData name="Kernel methods" defStyleNum="dsFunction" bold="1"/> <!-- #CC0E86 -->
0908 <itemData name="Module mixin methods" defStyleNum="dsFunction" bold="1"/> <!-- #CC0E86 -->
0909 <itemData name="Member" defStyleNum="dsNormal"/>
0910 <itemData name="Instance Variable" defStyleNum="dsOthers"/>
0911 <itemData name="Class Variable" defStyleNum="dsOthers"/>
0912
0913 <itemData name="Comment" defStyleNum="dsComment"/>
0914 <itemData name="Blockcomment" defStyleNum="dsComment"/>
0915
0916 <itemData name="Here Document" defStyleNum="dsDocumentation"/>
0917
0918 <itemData name="Delimiter" defStyleNum="dsKeyword"/> <!-- #FF9FEC -->
0919 <itemData name="Operator" defStyleNum="dsKeyword"/> <!-- #FF9FEC -->
0920 </itemDatas>
0921 </highlighting>
0922 <general>
0923 <comments>
0924 <comment name="singleLine" start="#" position="afterwhitespace"/>
0925 </comments>
0926 <keywords casesensitive="1" weakDeliminator="!?"/>
0927 </general>
0928 </language>
0929
0930 <!-- kate: replace-tabs off; -->