[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kate] part/syntax/data: syntax: add better puppet highlight
From: Michal Humpula <michal.humpula () seznam ! cz>
Date: 2014-02-17 17:55:51
Message-ID: E1WFSQ3-0003yX-A6 () scm ! kde ! org
[Download RAW message or body]
Git commit 9b51760be7a77624c248767c01660b4e4bdc4a09 by Michal Humpula.
Committed on 16/02/2014 at 20:39.
Pushed by michalhumpula into branch 'master'.
syntax: add better puppet highlight
REVIEW: 115819
M +542 -689 part/syntax/data/puppet.xml
http://commits.kde.org/kate/9b51760be7a77624c248767c01660b4e4bdc4a09
diff --git a/part/syntax/data/puppet.xml b/part/syntax/data/puppet.xml
index 53fc1d6..da0356d 100644
--- a/part/syntax/data/puppet.xml
+++ b/part/syntax/data/puppet.xml
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY BareWord "[a-z][a-zA-Z0-9-_]*">
+ <!ENTITY CapWord "[A-Z][a-zA-Z0-9-_]*">
+ <!ENTITY namespace "[a-z][a-z0-9_]*">
+]>
<!--
Puppet syntax highlighting file:
- Copyright (C) 2010 by Nick Shobe (nickshobe@gmail.com)
-
- This file is based on:
-
- Ruby syntax highlighting definition for Kate.
-
- Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot \
fi)
- Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at)
- Copyright (C) 2008 by Robin Pedersen (robinpeder@gmail.com)
+ Copyright (C) 2014 by Michal Humpula (michal.humpula@seznam.cz)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -30,827 +27,683 @@
Boston, MA 02110-1301, USA.
-->
-<!-- Hold the "language" opening tag on a single line, as mentioned in \
"language.dtd". -->
-<!-- This is based on the ruby syntax file -->
-<language
- name="Puppet"
- section="Scripts"
- version="1.18"
- kateversion="2.4"
- extensions="*.pp;*.xml.erb;*.erb"
- mimetype="application/x-puppet"
- style="puppet"
- indenter="ruby"
- author="Nick Shobe (nickshobe@gmail.com), Stefan Lang (langstefan@gmx.at), \
Sebastian Vuorinen (sebastian.vuorinen@helsinki.fi), Robin Pedersen \
(robinpeder@gmail.com)"
- license="LGPL"
->
+<language name="Puppet" section="Scripts" version="2.0" kateversion="2.4" \
extensions="*.pp" priority="10" mimetype="application/x-puppet" style="puppet" \
indenter="cstyle" author="Michal Humpula (michal.humpula@seznam.cz)" license="LGPL" > \
<highlighting>
-
<list name="keywords">
- <item> BEGIN </item>
- <item> END </item>
- <item> and </item>
- <item> begin </item>
- <item> break </item>
- <item> case </item>
- <item> defined? </item>
- <item> do </item>
- <item> else </item>
- <item> elsif </item>
- <item> end </item>
- <item> for </item>
- <item> if </item>
- <item> in </item>
- <item> include </item>
- <item> inherits </item>
- <item> next </item>
- <item> not </item>
- <item> or </item>
- <item> redo </item>
- <item> rescue </item>
- <item> retry </item>
- <item> return </item>
- <item> then </item>
- <item> unless </item>
- <item> until </item>
- <item> when </item>
- <item> while </item>
- <item> yield </item>
- </list>
-
- <list name="definitions">
- <item> alias </item>
- <item> module </item>
- <item> class </item>
- <item> define </item>
- <!--MOD<item> undef </item>-->
- </list>
-
- <list name="pseudo-variables">
- <item> self </item>
- <item> super </item>
- <item> nil </item>
- <item> false </item>
- <item> true </item>
- <item> caller </item>
- <item> __FILE__ </item>
- <item> __LINE__ </item>
+ <item>import</item>
+ <item>false</item>
+ <item>true</item>
+ <item>undef</item>
</list>
- <list name="metaparameters">
- <!-- backquote ` -->
- <item> alias </item>
- <item> audit </item>
- <item> subscribe </item>
- <item> before </item>
- <item> check </item>
- <item> loglevel </item>
- <item> noop </item>
- <item> notify </item>
- <item> require </item>
- <item> schedule </item>
- <item> stage </item>
- <item> subscribe </item>
- <item> tag </item>
+ <list name="operators">
+ <item>in</item>
+ <item>and</item>
+ <item>or</item>
</list>
- <list name="attention">
- <item> TODO </item>
- <item> FIXME </item>
- <item> NOTE </item>
+ <list name="collector operators">
+ <item>and</item>
+ <item>or</item>
</list>
<contexts>
- <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
- <!-- ruby ignores newline after \ -->
- <LineContinue attribute="Normal Text" context="Line Continue"/>
-
- <!-- __END__ token on own line. -->
- <RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/>
-
- <!-- "shebang" line -->
- <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
-
- <!-- "def" - "end" blocks -->
- <!-- check for statement modifiers with regexes -->
- <DetectChar attribute="Operator" char="{" context="Find closing block brace" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" \
String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def \
block"/>
- <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" \
context="#stay" beginRegion="def block" firstNonSpace="true"/>
- <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" \
context="#stay" beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" \
beginRegion="def block" firstNonSpace="true"/>
- <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bcase\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bdo\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bdef\b" context="#stay" \
beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def \
block"/>
- <!-- elsif/else close the current block and start a new one -->
- <RegExpr attribute="Keyword" String="\b(else|elsif|rescue)\b" \
context="#stay" endRegion="def block" beginRegion="def block"/>
-
- <StringDetect attribute="Operator" String="..." context="#stay"/>
- <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
-
- <!-- marks a message (being sent, not defined) -->
-<!-- <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" \
context="check_div_2"/> -->
-
- <!-- Check for "ASCII code operator". e.g.: ?a -->
- <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" \
context="check_div_1"/>
-
+ <context name="Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="common" />
+ </context>
+
+ <context name="common" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindOperator"/>
+ <Int attribute="Number" context="#stay" />
+ <IncludeRules context="FindUnless"/>
+ <IncludeRules context="FindIf"/>
+ <IncludeRules context="FindCase"/>
<keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <IncludeRules context="FindVariable"/>
- <keyword attribute="Definition" String="definitions" context="#stay" />
- <keyword attribute="Pseudo variable" String="pseudo-variables" \
context="check_div_1"/>
- <keyword attribute="Metaparameters" String="metaparameters" \
context="check_div_2"/>
-
- <!-- puppet attributes attribute => value -->
- <RegExpr attribute="Attribute" String="[a-zA-Z_0-9]+(?=\s*=>)" \
context="check_div_1"/> + <IncludeRules context="FindClass"/>
+ <IncludeRules context="FindNode"/>
- <!-- (global) vars starting with $
- Match them before $_.
- -->
- <RegExpr attribute="Variable" String="\$[a-zA-Z_0-9]+" \
context="check_div_1"/>
- <RegExpr attribute="Variable" String="\$\-[a-zA-z_]\b" \
context="check_div_1"/> + <IncludeRules context="FindCollector"/>
+ <IncludeRules context="FindExportedCollector"/>
- <RegExpr attribute="List" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" \
context="check_div_2"/> + <IncludeRules context="FindResource"/>
+ <IncludeRules context="FindResourceReference"/>
+ <IncludeRules context="FindResourceDefaults"/>
+ <IncludeRules context="FindDefine"/>
- <RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" \
context="check_div_1"/>
- <RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="check_div_1"/>
- <RegExpr attribute="Octal" String="\b\-?0[1-7][_0-7]*" \
context="check_div_1"/>
- <RegExpr attribute="Float" \
String="\b\-?[0-9][0-9_]*\.[0-9][0-9_]*([eE]\-?[1-9][0-9]*(\.[0-9]*)?)?" \
context="check_div_1"/>
- <RegExpr attribute="Dec" String="\b\-?[1-9][0-9_]*\b" \
context="check_div_1"/>
- <Int attribute="Dec" context="check_div_1"/>
- <!--<HlCChar attribute="Char" context="check_div_1"/>-->
+ <IncludeRules context="FindArray"/>
+ <IncludeRules context="FindHash"/>
- <!-- Check for =begin before assignment operator. -->
- <RegExpr attribute="Blockcomment" String="^=begin(?:\s|$)" context="Embedded \
documentation" beginRegion="comment block" column="0"/> + <IncludeRules \
context="FindFunction"/> + <IncludeRules context="FindStatement"/>
- <!-- recognize the beginning of a HEREDOC
- This uses new features in Kate 2.3 and later
-
- There is no other chance of keeping heredoc apart from the
- push operator '<<' than requiring to put space between the operator
- and the string.
- -->
- <RegExpr attribute="Operator" context="find_indented_heredoc" \
String="\s*<<-(?=\w+|["'])" beginRegion="HereDocument" />
- <RegExpr attribute="Operator" context="find_heredoc" \
String="\s*<<(?=\w+|["'])" beginRegion="HereDocument" /> + \
<IncludeRules context="FindBareWord"/> + </context>
- <DetectChar attribute="Operator" char="." context="#stay"/>
- <Detect2Chars attribute="Operator" char="&" char1="&" \
context="#stay"/>
- <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
- <RegExpr attribute="Operator" String="\s[\?\:\%]\s" context="#stay"/>
- <RegExpr attribute="Operator" String="[|&<>\^\+*~\-=]+" \
context="#stay"/>
- <!-- regexp hack -->
- <RegExpr attribute="Operator" String="\s!" context="#stay"/>
- <RegExpr attribute="Operator" String="/=\s" context="#stay" \
insensitive="0"/>
- <StringDetect attribute="Operator" String="%=" context="#stay" \
insensitive="0"/>
- <Detect2Chars attribute="Operator" char=":" char1=":" context="Member \
Access"/> + <!-- BEGIN Finders -->
+ <context name="FindString" attribute="" lineEndContext="#stay">
+ <DetectChar attribute="String" char="'" context="string single"/>
+ <DetectChar attribute="String" char=""" context="string double"/>
+ </context>
- <RegExpr attribute="Symbol" \
String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?" \
context="check_div_1"/>
- <RegExpr attribute="Symbol" String=":\[\]=?" contex="check_div_1"/>
+ <context name="FindComment" attribute="Comment" lineEndContext="#stay">
+ <StringDetect attribute="Region Marker" String="#BEGIN" beginRegion="region \
marker" firstNonSpace="true" context="region marker"/> + <StringDetect \
attribute="Region Marker" String="#END" endRegion="region marker" \
firstNonSpace="true" context="region marker"/> + <DetectChar \
attribute="Comment" char="#" context="comment"/> + <Detect2Chars \
attribute="Comment" char="/" char1="*" beginRegion="comment" context="multiline \
comment"/> + </context>
- <DetectChar attribute="String" char=""" context="Quoted String"/>
+ <context name="FindVariable" attribute="Variable" lineEndContext="#pop">
+ <RegExpr String="\$(::)?(&namespace;::)*&BareWord;" lookAhead="true" \
context="variable"/> + </context>
- <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
- <DetectChar attribute="Command" char="`" context="Command String"/>
+ <context name="FindStatement" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="Function" String="&BareWord;" context="statement" \
firstNonSpace="true"/> + </context>
- <StringDetect attribute="Normal Text" String="?#" context="#stay"/>
+ <context name="FindFunction" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr String="&BareWord;\s*\(" lookAhead="true" context="function"/>
+ </context>
- <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" \
beginRegion="marker" column="0"/>
- <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" \
endRegion="marker" column="0"/>
- <DetectChar attribute="Comment" char="#" context="General Comment"/>
+ <context name="FindResource" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr String="@?@?(::)?(&BareWord;::)*&BareWord;\s*\{" lookAhead="true" \
context="resource"/> + </context>
- <DetectChar attribute="Delimiter" char="[" context="#stay"/>
- <DetectChar attribute="Delimiter" char="]" context="check_div_1"/>
- <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def \
block"/>
- <DetectChar attribute="Delimiter" char="}" context="check_div_1" \
endRegion="def block"/> + <context name="FindResourceReference" \
attribute="Normal Text" lineEndContext="#pop"> + <RegExpr \
String="(::)?(&CapWord;::)*&CapWord;\s*\[" lookAhead="true" context="res_ref"/> + \
</context>
- <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" \
context="check_div_1"/>
- <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" \
context="check_div_1"/> + <context name="FindResourceDefaults" attribute="Normal \
Text" lineEndContext="#pop"> + <RegExpr \
String="(::)?(&CapWord;::)*&CapWord;\s*\{" lookAhead="true" context="res_defaults"/> \
+ </context>
+ <context name="FindOperator" attribute="Operator" lineEndContext="#pop" >
+ <keyword attribute="Operator" String="operators" context="#stay"/>
+ <DetectChar attribute="Operator" char="!" context="#stay"/>
+ <DetectChar attribute="Operator" char="*" context="#stay"/>
+ <DetectChar attribute="Operator" char="/" context="#stay"/>
+ <DetectChar attribute="Operator" char="-" context="#stay"/>
+ <DetectChar attribute="Operator" char="+" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="+" char1="=" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="<" char1="<" \
context="#stay"/> + <Detect2Chars attribute="Operator" char=">" \
char1=">" context="#stay"/> + <Detect2Chars attribute="Operator" char="=" \
char1="=" context="#stay"/> + <Detect2Chars attribute="Operator" char="!" \
char1="=" context="#stay"/> + <Detect2Chars attribute="Operator" char=">" \
char1="=" context="#stay"/> + <Detect2Chars attribute="Operator" char="<" \
char1="=" context="#stay"/> + <DetectChar attribute="Operator" char=">" \
context="#stay"/> + <DetectChar attribute="Operator" char="<" \
context="#stay"/> + <DetectChar attribute="Operator" char="?" \
context="selector"/>
- <!-- handle the different regular expression formats -->
- <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/>
+ <Detect2Chars attribute="Operator" char="=" char1="~" context="regexp \
operators"/> + <Detect2Chars attribute="Operator" char="!" char1="~" \
context="regexp operators"/>
- <!-- recognize the beginning of a general delimited input format -->
- <!-- this moves to the next context to separate out the exact nature of the \
GDL input -->
- <RegExpr attribute="GDL input" context="find_gdl_input" \
String="\s*[%](?=[Qqxw]?[^\s])" beginRegion="GdlInput" /> + <Detect2Chars \
attribute="Operator" char="-" char1=">" context="#stay"/> + <Detect2Chars \
attribute="Operator" char="~" char1=">" context="#stay"/> + </context>
- <DetectChar attribute="Normal Text" char=")" context="check_div_1"/>
- <DetectIdentifier attribute="Normal Text" context="check_div_2"/>
+ <context name="FindResourcePath" attribute="Normal Text" \
lineEndContext="#pop"> + <RegExpr \
String="(&BareWord;)?(::&BareWord;)*::&BareWord;" lookAhead="true" context="resource \
path"/> + </context>
+ <context name="FindBareWord" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="String" String="&BareWord;" context="#stay"/>
</context>
- <!-- In the following contexts, a slash character ('/') is a division operator \
-->
- <!-- Everywhere else, it's a regular expression delimiter -->
+ <context name="FindArray" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="[" context="array"/>
+ </context>
- <!-- A slash is always a division operator, even if preceeded by whitespace \
-->
- <context name="check_div_1" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop" lineEndContext="#pop">
- <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
- <AnyChar attribute="Operator" String="/%" context="#pop"/>
+ <context name="FindHash" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" lookAhead="true" context="hash"/>
</context>
- <!-- Same as check_div_1, but with double pop to exit the surrounding context \
-->
- <context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
- <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
- <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
+ <context name="FindClass" attribute="Normal Text" lineEndContext="#stay">
+ <WordDetect attribute="Keyword" String="class" context="class def"/>
</context>
- <!-- A slash is division operator if it's the first character, or if preceeded \
and followed by whitespace -->
- <context name="check_div_2" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop" lineEndContext="#pop">
- <AnyChar attribute="Operator" String="/%" context="#pop"/>
- <RegExpr attribute="Normal Text" String="\s+" \
context="check_div_2_internal"/> + <context name="FindNode" attribute="Normal \
Text" lineEndContext="#stay"> + <WordDetect attribute="Keyword" String="node" \
context="node def"/> </context>
- <!-- Internal context used by check_div_2 -->
- <context name="check_div_2_internal" attribute="Normal Text" \
fallthrough="true" fallthroughContext="#pop#pop" \
lineEndContext="#pop#pop">
-<!-- <DetectChar attribute="Operator" char="%" context="#pop#pop"/> -->
- <RegExpr attribute="Operator" String="[/%](?=\s)" context="#pop#pop"/>
+ <context name="FindDefine" attribute="Normal Text" lineEndContext="#stay">
+ <WordDetect attribute="Keyword" String="define" context="resource \
definition"/> </context>
- <!-- Same as check_div_2, but with double pop to exit the surrounding context \
-->
- <context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
- <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
- <RegExpr attribute="Normal Text" String="\s+" \
context="check_div_2_pop_internal"/> + <context name="FindCollector" \
attribute="Normal Text" lineEndContext="#stay"> + <RegExpr \
String="(::)?(&CapWord;::)*&CapWord;\s*<\|" lookAhead="true" context="collector"/> \
</context>
- <!-- Internal context used by check_div_2_pop -->
- <context name="check_div_2_pop_internal" attribute="Normal Text" \
fallthrough="true" fallthroughContext="#pop#pop#pop" \
lineEndContext="#pop#pop#pop">
- <DetectChar attribute="Operator" char="%" context="#pop#pop#pop"/>
- <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop#pop"/>
+ <context name="FindExportedCollector" attribute="Normal Text" \
lineEndContext="#stay"> + <RegExpr \
String="(::)?(&CapWord;::)*&CapWord;\s*<<\|" lookAhead="true" context="exported \
collector"/> </context>
- <context name="Line Continue" attribute="Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" \
context="#stay" firstNonSpace="true"/>
- <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" \
firstNonSpace="true"/>
- <IncludeRules context="Normal"/>
+ <context name="FindUnless" attribute="Normal Text" lineEndContext="#stay">
+ <WordDetect attribute="Keyword" String="unless" context="unless"/>
</context>
- <context name="Find closing block brace" attribute="Normal Text" \
lineEndContext="#stay">
- <DetectChar attribute="Operator" char="}" context="check_div_1_pop" \
endRegion="def block"/>
- <IncludeRules context="Normal"/>
+ <context name="FindIf" attribute="Normal Text" lineEndContext="#stay">
+ <WordDetect attribute="Keyword" String="if" context="if"/>
</context>
- <context name="Quoted String" attribute="String" lineEndContext="#stay">
- <StringDetect attribute="String" String="\\" context="#stay"/>
- <RegExpr attribute="String" String="\\\"" context="#stay"/>
- <RegExpr attribute="Variable" String="\$\{[a-zA-Z_0-9]+\}" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- <DetectChar char=""" attribute="String" context="check_div_1_pop"/>
+ <context name="FindCase" attribute="Normal Text" lineEndContext="#stay">
+ <WordDetect attribute="Keyword" String="case" context="case"/>
</context>
- <context name="Apostrophed String" attribute="Raw String" \
lineEndContext="#stay">
- <StringDetect attribute="String" String="\\" context="#stay"/>
- <RegExpr attribute="String" String="\\\'" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- <DetectChar char="'" attribute="Raw String" context="check_div_1_pop"/>
+ <context name="FindRegExp" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="RegExp" String="/[^/]*[^\\/]/" context="#stay"/>
</context>
+ <!-- END Finders -->
- <context name="Command String" attribute="Command" lineEndContext="#stay">
- <StringDetect attribute="String" String="\\" context="#stay"/>
- <RegExpr attribute="String" String="\\\`" context="#stay"/>
- <RegExpr attribute="Variable" String="\$\{[a-zA-Z_0-9]+\}" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- <DetectChar char="`" attribute="Command" context="check_div_1_pop"/>
+ <!-- BEGIN Strings -->
+ <context name="string single" attribute="String" lineEndContext="#stay">
+ <DetectChar attribute="String" char="'" context="#pop"/>
</context>
- <context name="Embedded documentation" attribute="Blockcomment" \
lineEndContext="#stay">
- <RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" \
endRegion="comment block" column="0"/> + <context name="string double" \
attribute="String" lineEndContext="#stay"> + <DetectChar attribute="Escape" \
char="\" context="escapes"/> + <Detect2Chars char="$" char1="{" \
lookAhead="true" context="string code block"/> + <RegExpr attribute="Variable" \
String="\$&BareWord;" context="#stay"/> + <DetectChar attribute="String" \
char=""" context="#pop"/> </context>
- <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
- <RegExpr attribute="Regular Expression" String="\\\/" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- <RegExpr attribute="Regular Expression" String="/[uiomxn]*" \
context="check_div_1_pop"/> + <context name="string code block" \
attribute="Variable" fallthrough="true" fallthroughContext="#pop" \
lineEndContext="#stay"> + <Detect2Chars attribute="Variable" char="$" \
char1="{" context="#stay"/> + <RegExpr attribute="Variable" \
String="&namespace;" context="#stay"/> + <Detect2Chars attribute="Normal Text" \
char=":" char1=":" context="#stay"/> + <RegExpr attribute="Variable" \
String="&BareWord;" context="#stay"/> + <DetectChar attribute="Variable" \
char="}" context="#pop"/> </context>
- <!-- Substitutions can be nested -->
- <context name="Subst" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar attribute="Substitution" char="}" context="#pop"/>
- <!-- Highlight substitution as code. -->
- <IncludeRules context="Normal"/>
+ <context name="escapes" attribute="Escape" fallthrough="true" \
fallthroughContext="#pop" lineEndContext="#pop"> + <AnyChar attribute="Escape" \
String="$"'\nrts" context="#pop"/> </context>
+ <!-- END Strings -->
- <context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
- <!-- Check for e.g.: "#@var#@@xy" -->
- <RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/>
- <RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
+ <!-- BEGIN RegExp -->
+ <context name="regexp operators" attribute="RegExp" lineEndContext="#pop">
+ <DetectSpaces/>
+ <RegExpr attribute="RegExp" String="/[^/]*[^\\/]/" context="#pop"/>
</context>
+ <!-- END RegExp -->
- <!-- This handles access of nested module classes and class methods -->
- <context name="Member Access" attribute="Member" lineEndContext="#pop">
- <!-- marks a message (being sent, not defined) -->
-<!-- <RegExpr attribute="Message" \
String="\.?[_a-z]\w*(\?|\!)?(?=[^\w\d\.\:])" \
context="check_div_2_pop"/> -->
- <RegExpr attribute="Subclass" String="\.?[_a-z]\w*(\?|\!)?" \
context="#stay"/>
- <RegExpr attribute="Constant" String="[A-Z]+_*(\d|[a-z])\w*(?=[^\w\d\.\:])" \
context="check_div_2_pop"/>
- <RegExpr attribute="Constant" String="[A-Z]+_*([0-9]|[a-z])\w*" \
context="#stay"/>
- <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" \
context="check_div_2_pop"/>
- <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" \
context="#stay"/>
- <Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/>
- <DetectChar attribute="Member" char="." context="#stay"/>
+ <!-- BEGIN Comments -->
+ <context name="comment" attribute="Comment" lineEndContext="#pop">
+ <IncludeRules context="##Alerts"/>
+ </context>
- <AnyChar attribute="Operator" String="=+-*/%|&[]{}~" context="#pop"/>
- <DetectChar attribute="Comment" char="#" context="#pop"/>
- <AnyChar attribute="Normal Text" String="()\" context="#pop"/>
- <RegExpr attribute="Member" String="\W" context="#pop"/>
+ <context name="multiline comment" attribute="Comment" lineEndContext="#stay">
+ <DetectSpaces/>
+ <Detect2Chars attribute="Comment" char="*" char1="/" endRegion="comment" \
context="#pop"/> + <IncludeRules context="##Alerts"/>
</context>
- <context name="Comment Line" attribute="Comment" lineEndContext="#pop">
- <RegExpr attribute="Comment" String="\w\:\:\s" context="RDoc Label"/>
- <keyword attribute="Alert" String="attention" context="#stay"/>
- </context>
-
- <context name="General Comment" attribute="Comment" lineEndContext="#pop">
- <keyword attribute="Dec" String="attention" context="#stay"/>
+ <context name="region marker" attribute="Region Marker" lineEndContext="#pop">
</context>
-
- <context name="RDoc Label" attribute="RDoc Value" lineEndContext="#pop"/>
-
- <!-- HEREDOC support
- The contexts below support both normal and indented heredocs
- -->
- <!-- here we markup the heredoc markers -->
- <context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" >
- <RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" \
String="'(\w+)'" />
- <RegExpr attribute="Keyword" context="normal_heredoc" \
String=""?(\w+)"?" />
- </context>
- <context name="find_indented_heredoc" attribute="Normal Text" \
lineEndContext="#pop" >
- <RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" \
String="'(\w+)'" />
- <RegExpr attribute="Keyword" context="indented_heredoc" \
String=""?(\w+)"?" />
- </context>
- <!-- these are the real heredoc contexts -->
- <context name="indented_heredoc" attribute="Here Document" \
lineEndContext="#stay" dynamic="true">
-<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" \
dynamic="true" endRegion="HereDocument"/>-->
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" \
endRegion="HereDocument" firstNonSpace="true"/>
- <IncludeRules context="heredoc_rules" />
- </context>
- <context name="apostrophed_indented_heredoc" attribute="Here Document" \
lineEndContext="#stay" dynamic="true">
-<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" \
dynamic="true" endRegion="HereDocument"/>-->
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" \
endRegion="HereDocument" firstNonSpace="true"/>
- </context>
-
- <context name="normal_heredoc" attribute="Here Document" \
lineEndContext="#stay" dynamic="true">
-<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" \
dynamic="true" endRegion="HereDocument"/>-->
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" \
endRegion="HereDocument" column="0"/>
- <IncludeRules context="heredoc_rules" />
- </context>
- <context name="apostrophed_normal_heredoc" attribute="Here Document" \
lineEndContext="#stay" dynamic="true">
-<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" \
dynamic="true" endRegion="HereDocument"/>-->
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" \
endRegion="HereDocument" column="0"/>
- </context>
-
- <!-- rules for heredoc types -->
- <context name="heredoc_rules" attribute="Normal Text" lineEndContext="#stay">
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- </context>
-
- <!-- General delimited input support
- The contexts below handle the various gdl formats
- -->
- <context name="find_gdl_input" attribute="Normal Text" lineEndContext="#pop">
-
- <!-- handle token arrays -->
- <RegExpr attribute="GDL input" context="gdl_token_array_1" String="w\(" />
- <RegExpr attribute="GDL input" context="gdl_token_array_2" String="w\{" />
- <RegExpr attribute="GDL input" context="gdl_token_array_3" String="w\[" />
- <RegExpr attribute="GDL input" context="gdl_token_array_4" String="w<" />
- <!-- then we handle the 'any char' format -->
- <RegExpr attribute="GDL input" context="gdl_token_array_5" \
String="w([^\s\w])" />
-
- <!-- handle apostrophed strings -->
- <RegExpr attribute="GDL input" context="gdl_apostrophed_1" String="q\(" />
- <RegExpr attribute="GDL input" context="gdl_apostrophed_2" String="q\{" />
- <RegExpr attribute="GDL input" context="gdl_apostrophed_3" String="q\[" />
- <RegExpr attribute="GDL input" context="gdl_apostrophed_4" String="q<" />
- <!-- then we handle the 'any char' format -->
- <RegExpr attribute="GDL input" context="gdl_apostrophed_5" \
String="q([^\s\w])" />
-
- <!-- handle shell commands -->
- <RegExpr attribute="GDL input" context="gdl_shell_command_1" String="x\(" />
- <RegExpr attribute="GDL input" context="gdl_shell_command_2" String="x\{" />
- <RegExpr attribute="GDL input" context="gdl_shell_command_3" String="x\[" />
- <RegExpr attribute="GDL input" context="gdl_shell_command_4" String="x<" \
/>
- <!-- then we handle the 'any char' format -->
- <RegExpr attribute="GDL input" context="gdl_shell_command_5" \
String="x([^\s\w])" />
-
- <!-- handle regular expressions -->
- <RegExpr attribute="GDL input" context="gdl_regexpr_1" String="r\(" />
- <RegExpr attribute="GDL input" context="gdl_regexpr_2" String="r\{" />
- <RegExpr attribute="GDL input" context="gdl_regexpr_3" String="r\[" />
- <RegExpr attribute="GDL input" context="gdl_regexpr_4" String="r<" />
- <!-- then we handle the 'any char' format -->
- <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" \
/>
-
- <!-- handle double-quoted strings -->
- <!--
- be careful to make this the last GDL ruleset, because the rule for
- the short form %?foo? will otherwise catch any of the other formats
- -->
- <RegExpr attribute="GDL input" context="gdl_dq_string_1" String="Q?\(" />
- <RegExpr attribute="GDL input" context="gdl_dq_string_2" String="Q?\{" />
- <RegExpr attribute="GDL input" context="gdl_dq_string_3" String="Q?\[" />
- <RegExpr attribute="GDL input" context="gdl_dq_string_4" String="Q?<" />
- <!-- then we handle the 'any char' format -->
- <RegExpr attribute="GDL input" context="gdl_dq_string_5" \
String="Q?([^\s\w])" />
-
- </context>
- <!-- double-quoted string specific contexts follow -->
- <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="dq_string_rules" />
- <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
- <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=")" \
endRegion="GdlInput" />
- </context>
- <context name="gdl_dq_string_1_nested" attribute="String" \
lineEndContext="#stay" >
- <IncludeRules context="dq_string_rules" />
- <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
- <DetectChar attribute="String" context="#pop" char=")" />
- </context>
- <!-- note that here substitution should win over nesting -->
- <context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="dq_string_rules" />
- <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
- <DetectChar attribute="GDL input" context="#pop#pop" char="}" \
endRegion="GdlInput" />
- <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
- </context>
- <context name="gdl_dq_string_2_nested" attribute="String" \
lineEndContext="#stay" >
- <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
- <DetectChar attribute="String" context="#pop" char="}" />
- <IncludeRules context="dq_string_rules" />
- </context>
-
- <context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="dq_string_rules" />
- <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
- <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
- <DetectChar attribute="GDL input" context="#pop#pop" char="]" \
endRegion="GdlInput" />
- </context>
- <context name="gdl_dq_string_3_nested" attribute="String" \
lineEndContext="#stay" >
- <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
- <DetectChar attribute="String" context="#pop" char="]" />
- <IncludeRules context="dq_string_rules" />
- </context>
-
- <context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="dq_string_rules" />
- <Detect2Chars attribute="String" char="\" char1=">" context="#stay"/>
- <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" \
/>
- <DetectChar attribute="GDL input" context="#pop#pop" char=">" \
endRegion="GdlInput" />
- </context>
- <context name="gdl_dq_string_4_nested" attribute="String" \
lineEndContext="#stay" >
- <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="<" \
/>
- <DetectChar attribute="String" context="#pop" char=">" />
- <IncludeRules context="dq_string_rules" />
- </context>
-
- <!-- this format doesn't allow nesting. it is terminated by the next occurence \
of the
- delimiter character
- -->
- <context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" \
dynamic="true">
- <IncludeRules context="dq_string_rules" />
- <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" />
- <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" \
dynamic="true" endRegion="GdlInput" />
- </context>
- <!-- rules to be included in all dq_string contexts -->
- <context name="dq_string_rules" attribute="String" lineEndContext="#stay" >
- <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
- </context>
-
- <!-- token array specific contexts -->
-
- <context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
- <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" \
/>
- <DetectChar attribute="GDL input" context="#pop#pop" char=")" \
endRegion="GdlInput" />
- </context>
- <context name="gdl_token_array_1_nested" attribute="String" \
lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" \
/>
- <DetectChar attribute="String" context="#pop" char=")" />
- </context>
-
- <context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
- <DetectChar attribute="GDL input" context="#pop#pop" char="}" \
endRegion="GdlInput" />
- <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" \
/>
- </context>
- <context name="gdl_token_array_2_nested" attribute="String" \
lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" \
/>
- <DetectChar attribute="String" context="#pop" char="}" />
- </context>
-
- <context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
- <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" \
/>
- <DetectChar attribute="GDL input" context="#pop#pop" char="]" \
endRegion="GdlInput" /> + <!-- END Comments -->
+
+ <!-- BEGIN Function -->
+ <context name="statement" attribute="Normal Text" lineEndContext="#pop">
+ <!-- TODO: can end with "," in which case the params continue on the next \
line --> + <IncludeRules context="parameter values"/>
</context>
- <context name="gdl_token_array_3_nested" attribute="String" \
lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" \
/>
- <DetectChar attribute="String" context="#pop" char="]" />
+
+ <context name="function" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <RegExpr attribute="Function" String="&BareWord;" context="#stay"/>
+ <DetectChar attribute="Normal Text" char="(" context="function_in"/>
+ <DetectChar attribute="Normal Text" char=")" context="#pop"/>
</context>
- <context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <Detect2Chars attribute="String" char="\" char1=">" context="#stay"/>
- <DetectChar attribute="String" context="gdl_token_array_4_nested" \
char="<" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=">" \
endRegion="GdlInput" /> + <context name="function_in" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <DetectChar char="," context="#stay"/>
+ <IncludeRules context="parameter values"/>
+ <DetectChar char=")" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_token_array_4_nested" attribute="String" \
lineEndContext="#stay" >
- <IncludeRules context="token_array_rules" />
- <DetectChar attribute="String" context="gdl_token_array_4_nested" \
char="<" />
- <DetectChar attribute="String" context="#pop" char=">" />
+ <!-- END Function -->
+
+ <!-- BEGIN conditions -->
+ <context name="unless" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="condition"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="code" \
context="code block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="code" context="#pop"/> </context>
- <!-- this format doesn't allow nesting. it is terminated by the next occurence \
of the
- delimiter character
- -->
- <context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" \
dynamic="true">
- <IncludeRules context="token_array_rules" />
- <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/>
- <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" \
dynamic="true" endRegion="GdlInput" /> + <context name="if" attribute="Normal \
Text" lineEndContext="#stay"> + <DetectSpaces/>
+ <IncludeRules context="condition"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="code" \
context="code block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="code" context="if continues?"/> </context>
- <!-- rules to be included in all token_array contexts -->
- <context name="token_array_rules" attribute="String" lineEndContext="#stay" >
- <StringDetect attribute="String" String="\\" context="#stay"/>
+ <context name="if continues?" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop#pop" lineEndContext="#stay"> + <DetectSpaces/>
+ <WordDetect attribute="Keyword" String="else" context="else"/>
+ <WordDetect attribute="Keyword" String="elsif" context="elsif"/>
</context>
- <!-- apostrophed string specific contexts -->
+ <context name="elsif" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="condition"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="code" \
context="code block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="dode" context="#pop"/> + </context>
- <context name="gdl_apostrophed_1" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/>
- <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" \
char="(" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=")" \
endRegion="GdlInput" /> + <context name="else" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="code" \
context="code block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="code" context="#pop#pop#pop"/> </context>
- <context name="gdl_apostrophed_1_nested" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" \
char="(" />
- <DetectChar attribute="Raw String" context="#pop" char=")" />
+
+ <context name="case" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindVariable"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="case" \
context="case block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="case" context="#pop"/> </context>
- <context name="gdl_apostrophed_2" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/>
- <DetectChar attribute="GDL input" context="#pop#pop" char="}" \
endRegion="GdlInput" />
- <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" \
char="{" /> + <context name="case block" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <DetectChar attribute="Normal Text" char="," context="#stay"/>
+ <DetectChar attribute="Operator" char=":" context="case value"/>
+ <Int attribute="Number" context="#stay" />
+ <WordDetect attribute="Keyword" String="default" context="#stay"/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindRegExp"/>
+ <IncludeRules context="FindFunction"/>
+ <IncludeRules context="FindBareWord"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_apostrophed_2_nested" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" \
char="{" />
- <DetectChar attribute="Raw String" context="#pop" char="}" />
+
+ <context name="case value" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="code" \
context="code block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="code" context="#pop"/> </context>
- <context name="gdl_apostrophed_3" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/>
- <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" \
char="[" />
- <DetectChar attribute="GDL input" context="#pop#pop" char="]" \
endRegion="GdlInput" /> + <context name="selector" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="selector" \
context="selector block"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="selector" context="#pop"/> </context>
- <context name="gdl_apostrophed_3_nested" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" \
char="[" />
- <DetectChar attribute="Raw String" context="#pop" char="]" />
+
+ <context name="selector block" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <Detect2Chars attribute="Operator" char="=" char1=">" context="selector \
value"/> + <Int attribute="Number" context="#stay" />
+ <WordDetect attribute="Keyword" String="default" context="#stay"/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindRegExp"/>
+ <IncludeRules context="FindFunction"/>
+ <IncludeRules context="FindBareWord"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_apostrophed_4" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <Detect2Chars attribute="Raw String" char="\" char1=">" context="#stay"/>
- <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" \
char="<" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=">" \
endRegion="GdlInput" /> + <context name="selector value" attribute="Normal Text" \
lineEndContext="#pop"> + <IncludeRules context="parameter values"/>
+ <DetectChar attribute="Normal Text" char="," context="#pop"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_apostrophed_4_nested" attribute="Raw String" \
lineEndContext="#stay" >
- <IncludeRules context="apostrophed_rules" />
- <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" \
char="<" />
- <DetectChar attribute="Raw String" context="#pop" char=">" />
+
+ <context name="code block" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="common"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
+ <!-- END conditions -->
- <!-- this format doesn't allow nesting. it is terminated by the next occurence \
of the
- delimiter character
- -->
- <context name="gdl_apostrophed_5" attribute="Raw String" \
lineEndContext="#stay" dynamic="true">
- <IncludeRules context="apostrophed_rules" />
- <RegExpr attribute="Raw String" String="\\%1" context="#stay" \
dynamic="true"/>
- <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" \
dynamic="true" endRegion="GdlInput" /> + <context name="variable" \
attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" \
lineEndContext="#pop"> + <DetectChar attribute="Variable" char="$" \
context="#stay"/> + <RegExpr attribute="Variable" String="&namespace;" \
context="#stay"/> + <Detect2Chars attribute="Normal Text" char=":" char1=":" \
context="#stay"/> + <RegExpr attribute="Variable" String="&BareWord;" \
context="#pop"/> </context>
- <!-- rules to be included in all apostrophed contexts -->
- <context name="apostrophed_rules" attribute="Raw String" \
lineEndContext="#stay" >
- <Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/>
+ <context name="array" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="list content"/>
+ <DetectChar attribute="Normal Text" char="]" context="#pop"/>
</context>
- <!-- shell command specific contexts -->
+ <!-- BEGIN Hash -->
+ <context name="hash" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Normal Text" char="{" beginRegion="hash" \
context="hash list"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="hash" context="#pop"/> + </context>
- <context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" \
>
- <IncludeRules context="shell_command_rules" />
- <Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/>
- <DetectChar attribute="Command" context="gdl_shell_command_1_nested" \
char="(" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=")" \
endRegion="GdlInput" /> + <context name="hash list" attribute="Normal Text" \
lineEndContext="#stay"> + <Detect2Chars attribute="AttributeOp" char="=" \
char1=">" context="#stay"/> + <DetectChar attribute="Normal Text" char="," \
context="#stay"/> + <IncludeRules context="hash keys"/>
+ <IncludeRules context="parameter values"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_shell_command_1_nested" attribute="Command" \
lineEndContext="#stay" >
- <IncludeRules context="shell_command_rules" />
- <DetectChar attribute="Command" context="gdl_shell_command_1_nested" \
char="(" />
- <DetectChar attribute="Command" context="#pop" char=")" />
+ <!-- END Hash -->
+
+ <!-- BEGIN Node -->
+ <context name="node def" attribute="Normal Text" lineEndContext="#stay">
+ <!-- TODO: need a regular expresion here, order is random and seems that \
Class is not allowed in node(?) --> + <DetectSpaces/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindRegExp"/>
+ <StringDetect attribute="Keyword" String="inherits" context="#stay"/>
+ <StringDetect attribute="Keyword" String="default" context="#stay"/>
+ <RegExpr attribute="Node" String="&namespace;" context="#stay"/>
+ <DetectChar char="{" lookAhead="true" context="node in open"/>
</context>
- <context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" \
>
- <IncludeRules context="shell_command_rules" />
- <Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/>
- <DetectChar attribute="GDL input" context="#pop#pop" char="}" \
endRegion="GdlInput" />
- <DetectChar attribute="Command" context="gdl_shell_command_2_nested" \
char="{" /> + <context name="node in open" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectChar attribute="Normal Text" char="{" \
beginRegion="node" context="node in"/> + <DetectChar attribute="Normal Text" \
char="}" endRegion="node" context="#pop#pop"/> </context>
- <context name="gdl_shell_command_2_nested" attribute="Command" \
lineEndContext="#stay" >
- <IncludeRules context="shell_command_rules" />
- <DetectChar attribute="Command" context="gdl_shell_command_2_nested" \
char="{" />
- <DetectChar attribute="Command" context="#pop" char="}" />
+
+ <context name="node in" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="common"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
+ <!-- END Node -->
- <context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" \
>
- <IncludeRules context="shell_command_rules" />
- <Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/>
- <DetectChar attribute="Command" context="gdl_shell_command_3_nested" \
char="[" />
- <DetectChar attribute="GDL input" context="#pop#pop" char="]" \
endRegion="GdlInput" /> + <!-- BEGIN Class -->
+ <context name="class def" attribute="Normal Text" lineEndContext="#stay">
+ <!-- TODO: be more strict here -->
+ <DetectSpaces/>
+ <StringDetect attribute="Keyword" String="inherits" context="#stay"/>
+ <RegExpr attribute="Class" String="&namespace;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <DetectChar char="(" context="class params"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="class" \
context="class in"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="class" context="#pop"/> </context>
- <context name="gdl_shell_command_3_nested" attribute="Command" \
lineEndContext="#stay" >
- <IncludeRules context="shell_command_rules" />
- <DetectChar attribute="Command" context="gdl_shell_command_3_nested" \
char="[" />
- <DetectChar attribute="Command" context="#pop" char="]" />
+
+ <context name="class params" attribute="Normal Text" lineEndContext="#stay">
+ <!-- TODO: be more strict here -->
+ <DetectSpaces/>
+ <DetectChar char="=" context="#stay"/>
+ <DetectChar char="," context="#stay"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="parameter values"/>
+ <DetectChar char=")" context="#pop"/>
</context>
- <context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" \
>
- <IncludeRules context="shell_command_rules" />
- <Detect2Chars attribute="Command" char="\" char1=">" context="#stay"/>
- <DetectChar attribute="Command" context="gdl_shell_command_4_nested" \
char="<" />
- <DetectChar attribute="GDL input" context="#pop#pop" char=">" \
endRegion="GdlInput" /> + <context name="class in" attribute="Normal Text" \
lineEndContext="#stay"> + <IncludeRules context="common"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_shell_command_4_nested" attribute="Command" \
lineEndContext="#stay" >
- <IncludeRules context="shell_command_rules" />
- <DetectChar attribute="Command" context="gdl_shell_command_4_nested" \
char="<" />
- <DetectChar attribute="Command" context="#pop" char=">" />
+ <!-- END Class -->
+
+ <!-- BEGIN Resource -->
+ <context name="resource" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectChar attribute="Resource" char="@" context="#stay"/>
+ <RegExpr attribute="Resource" String="&BareWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="resource" \
context="resource_in"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="resource" context="#pop"/> </context>
- <!-- this format doesn't allow nesting. it is terminated by the next occurence \
of the
- delimiter character
- -->
- <context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" \
dynamic="true">
- <IncludeRules context="shell_command_rules" />
- <RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" />
- <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" \
dynamic="true" endRegion="GdlInput" /> + <context name="resource_in" \
attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindArray"/>
+ <IncludeRules context="FindBareWord"/>
+ <DetectChar attribute="Operator" char=":" context="resource_attrs"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <!-- rules to be included in all shell_command contexts -->
- <context name="shell_command_rules" attribute="Command" lineEndContext="#stay" \
>
- <Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <context name="resource_attrs" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <RegExpr attribute="Attribute Name" String="&BareWord;" \
context="resource_attr"/> + <IncludeRules context="FindComment"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <!-- regular expression specific contexts -->
+ <context name="resource_attr" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <Detect2Chars attribute="AttributeOp" char="=" char1=">" \
context="resource_attr_val"/> + <DetectChar char="}" lookAhead="true" \
context="#pop"/> + </context>
- <context name="gdl_regexpr_1" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <Detect2Chars attribute="Regular Expression" char="\" char1=")" \
context="#stay"/>
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" \
char="(" />
- <RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" \
endRegion="GdlInput" /> + <context name="resource_attr_val" attribute="Normal \
Text" lineEndContext="#stay"> + <IncludeRules context="parameter values"/>
+ <DetectChar attribute="Normal Text" char="," context="#pop#pop"/>
+ <DetectChar attribute="Normal Text" char=";" context="#pop#pop#pop"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_regexpr_1_nested" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" \
char="(" />
- <DetectChar attribute="Regular Expression" context="#pop" char=")" />
+ <!-- END Resource -->
+
+ <!-- BEGIN Resource Reference -->
+ <context name="res_ref" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <RegExpr attribute="ResourceReference" String="&CapWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <DetectChar attribute="Normal Text" char="[" context="res_ref_titles"/>
</context>
- <context name="gdl_regexpr_2" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <Detect2Chars attribute="Regular Expression" char="\" char1="}" \
context="#stay"/>
- <RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" \
endRegion="GdlInput" />
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" \
char="{" /> + <context name="res_ref_titles" attribute="Normal Text" \
lineEndContext="#stay"> + <IncludeRules context="list content"/>
+ <DetectChar attribute="Normal Text" char="]" context="res_ref_params_opt"/>
</context>
- <context name="gdl_regexpr_2_nested" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" \
char="{" />
- <DetectChar attribute="Regular Expression" context="#pop" char="}" />
+
+ <context name="res_ref_params_opt" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop#pop#pop" lineEndContext="#stay"> + <DetectSpaces/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="res ref" \
context="res_ref_params"/> </context>
- <context name="gdl_regexpr_3" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <Detect2Chars attribute="Regular Expression" char="\" char1="]" \
context="#stay"/>
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" \
char="[" />
- <RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" \
endRegion="GdlInput" /> + <context name="res_ref_params" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <RegExpr attribute="Attribute Name" String="&BareWord;" \
context="res_ref_param"/> + <IncludeRules context="FindComment"/>
+ <DetectChar attribute="Normal Text" char="}" endRegion="res ref" \
context="#pop#pop#pop#pop"/> </context>
- <context name="gdl_regexpr_3_nested" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" \
char="[" />
- <DetectChar attribute="Regular Expression" context="#pop" char="]" />
+
+ <context name="res_ref_param" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <Detect2Chars attribute="AttributeOp" char="=" char1=">" \
context="res_ref_param_val"/> + <Detect2Chars attribute="AttributeOp" char="+" \
char1=">" context="res_ref_param_val"/> + <DetectChar char="}" \
lookAhead="true" context="#pop"/> </context>
- <context name="gdl_regexpr_4" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <Detect2Chars attribute="Regular Expression" char="\" char1=">" \
context="#stay"/>
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" \
char="<" />
- <RegExpr attribute="GDL input" context="#pop#pop" String=">[uiomxn]*" \
endRegion="GdlInput" /> + <context name="res_ref_param_val" attribute="Normal \
Text" lineEndContext="#stay"> + <IncludeRules context="parameter values"/>
+ <DetectChar attribute="Normal Text" char="," context="#pop#pop"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
</context>
- <context name="gdl_regexpr_4_nested" attribute="Regular Expression" \
lineEndContext="#stay" >
- <IncludeRules context="regexpr_rules" />
- <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" \
char="<" />
- <DetectChar attribute="Regular Expression" context="#pop" char=">" />
+ <!-- END Resource Reference -->
+
+ <!-- BEGIN Resource Defaults -->
+ <context name="res_defaults" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <RegExpr attribute="ResourceReference" String="&CapWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="res defs" \
context="res_defaults_params"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="res defs" context="#pop"/> </context>
- <!-- this format doesn't allow nesting. it is terminated by the next occurence \
of the
- delimiter character
- -->
- <context name="gdl_regexpr_5" attribute="Regular Expression" \
lineEndContext="#stay" dynamic="true">
- <IncludeRules context="regexpr_rules" />
- <RegExpr attribute="Regular Expression" String="\\%1" context="#stay" \
dynamic="true" />
- <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" \
dynamic="true" endRegion="GdlInput" /> + <context name="res_defaults_params" \
attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <RegExpr attribute="Attribute Name" String="&BareWord;" \
context="res_defaults_param"/> + <DetectChar char="}" lookAhead="true" \
context="#pop"/> </context>
- <!-- rules to be included in all regexpr contexts -->
- <context name="regexpr_rules" attribute="Regular Expression" \
lineEndContext="#stay" >
- <Detect2Chars attribute="Regular Expression" char="\" char1="\" \
context="#stay"/>
- <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
- <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <context name="res_defaults_param" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <Detect2Chars attribute="AttributeOp" char="=" char1=">" \
context="res_defaults_param_val"/> + <DetectChar char="}" lookAhead="true" \
context="#pop"/> </context>
- <!-- END of General delimited input support -->
+ <context name="res_defaults_param_val" attribute="Normal Text" \
lineEndContext="#stay"> + <IncludeRules context="parameter values"/>
+ <DetectChar attribute="Normal Text" char="," context="#pop#pop"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
+ </context>
+ <!-- END Resource Defaults -->
- <!-- handle data in script -->
- <context name="DATA" attribute="Data" lineEndContext="#stay"/>
- </contexts>
+ <!-- BEGIN Collector -->
+ <context name="collector" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <RegExpr attribute="Collector" String="&CapWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char="<" char1="|" \
context="collector in"/> + <Detect2Chars attribute="Normal Text" char="|" \
char1=">" context="#pop"/> + </context>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
-
- <itemData name="Keyword" defStyleNum="dsKeyword"/>
- <itemData name="Attribute Definition" defStyleNum="dsOthers"/>
- <itemData name="Access Control" defStyleNum="dsKeyword"/>
- <itemData name="Definition" defStyleNum="dsKeyword"/>
- <itemData name="Pseudo variable" defStyleNum="dsDecVal"/>
-
- <itemData name="Dec" defStyleNum="dsDecVal"/>
- <itemData name="Float" defStyleNum="dsFloat"/>
- <!--MOD<itemData name="Char" defStyleNum="dsChar"/>-->
- <itemData name="Octal" defStyleNum="dsBaseN"/>
- <itemData name="Hex" defStyleNum="dsBaseN"/>
- <itemData name="Bin" defStyleNum="dsBaseN"/>
-
- <itemData name="Symbol" defStyleNum="dsString"/>
- <itemData name="String" defStyleNum="dsString"/>
- <itemData name="Raw String" defStyleNum="dsString"/>
- <itemData name="Command" defStyleNum="dsString"/>
-<!-- <itemData name="Message" defStyleNum="dsNormal" color="#034B8E"/> -->
- <itemData name="Regular Expression" defStyleNum="dsOthers"/>
- <itemData name="Substitution" defStyleNum="dsOthers"/>
- <itemData name="Data" defStyleNum="dsNormal"/>
- <!-- short for 'general delimited input' -->
- <itemData name="GDL input" defStyleNum="dsOthers" />
+ <context name="collector in" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="collector content"/>
+ <DetectChar char="|" char1=">" lookAhead="true" context="#pop"/>
+ </context>
+ <!-- END Collector -->
+ <!-- BEGIN Exported Collector -->
+ <context name="exported collector" attribute="Normal Text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <RegExpr attribute="Collector" String="&CapWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <StringDetect attribute="Normal Text" String="<<|" context="exported \
collector in"/> + <StringDetect attribute="Normal Text" String="|>>" \
context="#pop"/> + </context>
- <itemData name="Variable" defStyleNum="dsDataType"/>
+ <context name="exported collector in" attribute="Normal Text" \
lineEndContext="#stay"> + <IncludeRules context="collector content"/>
+ <StringDetect String="|>>" lookAhead="true" context="#pop"/>
+ </context>
+ <!-- END Exported Collector -->
- <itemData name="Constant" defStyleNum="dsDataType"/>
- <itemData name="List" defStyleNum="dsDataType"/>
- <itemData name="Constant Value" defStyleNum="dsDataType"/>
- <itemData name="Attribute" defStyleNum="dsNormal"/>
- <itemData name="Metaparameters" defStyleNum="dsNormal"/>
- <itemData name="Member" defStyleNum="dsNormal"/>
- <itemData name="Instance Variable" defStyleNum="dsOthers"/>
- <itemData name="Class Variable" defStyleNum="dsOthers"/>
+ <context name="resource path" attribute="Normal Text" fallthrough="true" \
fallthroughContext="#pop" lineEndContext="#pop"> + <DetectSpaces/>
+ <RegExpr attribute="Resource" String="&BareWord;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ </context>
- <itemData name="Subclass" defStyleNum="dsNormal"/>
+ <!-- BEGIN define -->
+ <context name="resource definition" attribute="Normal Text" \
lineEndContext="#stay"> + <!-- TODO: be more strict here -->
+ <DetectSpaces/>
+ <StringDetect attribute="Keyword" String="inherits" context="#stay"/>
+ <RegExpr attribute="Class" String="&namespace;" context="#stay"/>
+ <Detect2Chars attribute="Normal Text" char=":" char1=":" context="#stay"/>
+ <DetectChar char="(" context="define params"/>
+ <DetectChar attribute="Normal Text" char="{" beginRegion="define" \
context="define in"/> + <DetectChar attribute="Normal Text" char="}" \
endRegion="define" context="#pop"/> + </context>
- <itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Blockcomment" defStyleNum="dsComment"/>
- <itemData name="Region Marker" defStyleNum="dsNormal"/>
- <itemData name="RDoc Value" defStyleNum="dsOthers"/>
+ <context name="define params" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectChar char="=" context="#stay"/>
+ <DetectChar char="," context="#stay"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="parameter values"/>
+ <DetectChar char=")" context="#pop"/>
+ </context>
+
+ <context name="define in" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="common"/>
+ <DetectChar char="}" lookAhead="true" context="#pop"/>
+ </context>
+ <!-- END define -->
- <itemData name="Here Document" defStyleNum="dsOthers"/>
+ <!-- BEGIN Contents -->
+ <context name="list content" attribute="Normal text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="FindOperator"/>
+ <Int attribute="Number" context="#stay"/>
+ <IncludeRules context="FindResourceReference"/>
+ <IncludeRules context="FindFunction"/>
+ <IncludeRules context="FindBareWord"/>
+ <DetectChar char="," context="#stay"/>
+ </context>
- <!-- use these to mark errors and alerts things -->
- <itemData name="Error" defStyleNum="dsError" />
- <itemData name="Alert" defStyleNum="dsAlert" />
+ <context name="parameter values" attribute="Normal text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindOperator"/>
+ <keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="FindResourceReference"/>
+ <IncludeRules context="FindArray"/>
+ <IncludeRules context="FindFunction"/>
+ <IncludeRules context="FindResourcePath"/>
+ <IncludeRules context="FindBareWord"/>
+ </context>
+
+ <context name="hash keys" attribute="Normal text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindComment"/>
+ <Int attribute="Number" context="#stay"/>
+ <IncludeRules context="FindBareWord"/>
+ </context>
+
+ <context name="collector content" attribute="Normal text" \
lineEndContext="#stay"> + <DetectSpaces/>
+ <keyword attribute="Operator" String="collector operators" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="=" char1="=" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="!" char1="=" context="#stay"/>
+ <IncludeRules context="FindString"/>
+ <Int attribute="Number" context="#stay"/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindBareWord"/>
+ </context>
+
+ <context name="condition" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="FindComment"/>
+ <IncludeRules context="FindString"/>
+ <IncludeRules context="FindOperator"/>
+ <Int attribute="Number" context="#stay" />
+ <keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <IncludeRules context="FindVariable"/>
+ <IncludeRules context="FindResourceReference"/>
+ <IncludeRules context="FindArray"/>
+ <IncludeRules context="FindFunction"/>
+ <IncludeRules context="FindBareWord"/>
+ </context>
- <itemData name="Delimiter" defStyleNum="dsNormal"/>
- <itemData name="Expression" defStyleNum="dsOthers"/>
- <itemData name="Operator" defStyleNum="dsNormal"/>
+ <!-- END Contents -->
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Escape" defStyleNum="dsFloat"/>
+ <itemData name="RegExp" defStyleNum="dsOthers" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
+ <itemData name="Variable" defStyleNum="dsChar" spellChecking="false"/>
+ <itemData name="Number" defStyleNum="dsDecVal" spellChecking="false"/>
+ <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
+ <itemData name="Operator" defStyleNum="dsOthers" spellChecking="false"/>
+
+ <itemData name="Attribute Name" defStyleNum="dsKeyword" italic="true" \
bold="false" spellChecking="false"/> + <itemData name="AttributeOp" \
defStyleNum="dsOthers" spellChecking="false"/> +
+ <itemData name="Node" defStyleNum="dsDataType" spellChecking="false"/>
+ <itemData name="Class" defStyleNum="dsOthers" spellChecking="false"/>
+ <itemData name="Resource" defStyleNum="dsDataType" spellChecking="false"/>
+ <itemData name="ResourceReference" defStyleNum="dsOthers" \
spellChecking="false"/> + <itemData name="Collector" defStyleNum="dsOthers" \
spellChecking="false"/> + <itemData name="Region Marker" \
defStyleNum="dsRegionMarker" spellChecking="false"/> </itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#"/>
+ <comment name="multiLine" start="/*" end="*/" />
</comments>
- <keywords casesensitive="1" weakDeliminator="!?"/>
+ <keywords casesensitive="1" />
</general>
</language>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic