Permalink
Browse files

Added (preliminary) x10 mode

  • Loading branch information...
1 parent 9ee99c6 commit 3c81e8c625b4b7af4803c0905f8f0b15ece09193 @djspiewak committed Feb 5, 2012
Showing with 260 additions and 0 deletions.
  1. +260 −0 x10.xml
View
260 x10.xml
@@ -0,0 +1,260 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+
+<MODE>
+ <PROPS>
+ <PROPERTY NAME="indentOpenBrackets" VALUE="{" />
+ <PROPERTY NAME="indentCloseBrackets" VALUE="}" />
+ <PROPERTY NAME="lineUpClosingBracket" VALUE="true" />
+ <PROPERTY NAME="indentNextLine"
+ VALUE="(.*((if|while|else\s+if|for)\s*\().*\)|\s*else|\s*case.*=>|.*(def|val|var|type).*=)\s*$"/>
+ <!-- set this to 'true' if you want to use GNU coding style -->
+ <PROPERTY NAME="doubleBracketIndent" VALUE="false" />
+ <PROPERTY NAME="commentStart" VALUE="/*" />
+ <PROPERTY NAME="commentEnd" VALUE="*/" />
+ <PROPERTY NAME="lineComment" VALUE="//" />
+ <PROPERTY NAME="noTabs" VALUE="true" />
+ <PROPERTY NAME="tabSize" VALUE="2" />
+ <PROPERTY NAME="indentSize" VALUE="2" />
+ <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*" />
+ </PROPS>
+
+ <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
+ DIGIT_RE="(0[lL]?|[1-9]\d{0,9}(\d{0,9}[lL])?|0[xX]\p{XDigit}{1,8}(\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))">
+
+ <MARK_FOLLOWING TYPE="LABEL">@</MARK_FOLLOWING>
+
+ <!-- Silly comment -->
+ <SEQ TYPE="COMMENT1">/**/</SEQ>
+
+ <EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
+
+ <SPAN TYPE="COMMENT3" DELEGATE="DOC">
+ <BEGIN>/**</BEGIN>
+ <END>*/</END>
+ </SPAN>
+
+ <SPAN TYPE="COMMENT1">
+ <BEGIN>/*</BEGIN>
+ <END>*/</END>
+ </SPAN>
+
+ <SPAN MATCH_TYPE="NULL" DELEGATE="MAIN">
+ <BEGIN>{</BEGIN>
+ <END>}</END>
+ </SPAN>
+
+ <!-- XML literals; keep this in sync with the XML_LITERAL rule set! -->
+ <IMPORT DELEGATE="XML_SHARED"/>
+
+ <!-- string and character literals -->
+ <SPAN TYPE="LITERAL1" NO_LINE_BREAK="FALSE" ESCAPE="FALSE">
+ <BEGIN>"""</BEGIN>
+ <END>"""</END>
+ </SPAN>
+ <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
+ <BEGIN>"</BEGIN>
+ <END>"</END>
+ </SPAN>
+ <SEQ_REGEXP HASH_CHAR="'" TYPE="LITERAL1">'([^'\\]|\\.)'</SEQ_REGEXP>
+
+ <!-- symbol literals -->
+ <SEQ_REGEXP HASH_CHAR="'" TYPE="LABEL">'[0-9a-zA-Z&gt;&lt;=+]([0-9a-zA-Z&gt;&lt;=+]|_[0-9a-zA-Z&gt;&lt;=+])*</SEQ_REGEXP>
+
+ <SPAN MATCH_TYPE="LITERAL3" DELEGATE="TYPE_PARAMS">
+ <BEGIN>[</BEGIN>
+ <END>]</END>
+ </SPAN>
+
+ <SPAN MATCH_TYPE="NULL">
+ <BEGIN>`</BEGIN>
+ <END>`</END>
+ </SPAN>
+
+ <SEQ TYPE="OPERATOR">(</SEQ>
+ <SEQ TYPE="OPERATOR">)</SEQ>
+ <SEQ TYPE="OPERATOR">}</SEQ>
+ <SEQ TYPE="OPERATOR">{</SEQ>
+ <SEQ TYPE="NULL">.</SEQ>
+ <SEQ TYPE="NULL">,</SEQ>
+ <SEQ TYPE="NULL">;</SEQ>
+ <SEQ TYPE="NULL">:</SEQ>
+
+ <!-- Function calls -->
+ <!-- <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS> -->
+
+ <!-- Function declarations (overloaded for different spacing styles)-->
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+ <MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE">def </MARK_FOLLOWING>
+
+ <SPAN DELEGATE="PATTERN" MATCH_TYPE="KEYWORD1" AT_WORD_START="TRUE" NO_LINE_BREAK="TRUE">
+ <BEGIN>case </BEGIN>
+ <END>=&gt;</END>
+ </SPAN>
+
+ <KEYWORDS>
+ <KEYWORD1>abstract</KEYWORD1>
+ <KEYWORD1>as</KEYWORD1>
+ <KEYWORD1>assert</KEYWORD1>
+ <KEYWORD1>async</KEYWORD1>
+ <KEYWORD1>at</KEYWORD1>
+ <KEYWORD1>ateach</KEYWORD1>
+ <KEYWORD1>atomic</KEYWORD1>
+ <KEYWORD1>break</KEYWORD1>
+ <KEYWORD1>case</KEYWORD1>
+ <KEYWORD1>catch</KEYWORD1>
+ <KEYWORD1>class</KEYWORD1>
+ <KEYWORD1>clocked</KEYWORD1>
+ <KEYWORD1>continue</KEYWORD1>
+ <KEYWORD1>def</KEYWORD1>
+ <KEYWORD1>default</KEYWORD1>
+ <KEYWORD1>do</KEYWORD1>
+ <KEYWORD1>else</KEYWORD1>
+ <KEYWORD1>extends</KEYWORD1>
+ <KEYWORD1>false</KEYWORD1>
+ <KEYWORD1>final</KEYWORD1>
+ <KEYWORD1>finally</KEYWORD1>
+ <KEYWORD1>finish</KEYWORD1>
+ <KEYWORD1>for</KEYWORD1>
+ <KEYWORD1>goto</KEYWORD1>
+ <KEYWORD1>haszero</KEYWORD1>
+ <KEYWORD1>here</KEYWORD1>
+ <KEYWORD1>if</KEYWORD1>
+ <KEYWORD1>implements</KEYWORD1>
+ <KEYWORD1>import</KEYWORD1>
+ <KEYWORD1>in</KEYWORD1>
+ <KEYWORD1>instanceof</KEYWORD1>
+ <KEYWORD1>interface</KEYWORD1>
+ <KEYWORD1>native</KEYWORD1>
+ <KEYWORD1>new</KEYWORD1>
+ <KEYWORD1>next</KEYWORD1>
+ <KEYWORD1>null</KEYWORD1>
+ <KEYWORD1>offer</KEYWORD1>
+ <KEYWORD1>offers</KEYWORD1>
+ <KEYWORD1>operator</KEYWORD1>
+ <KEYWORD1>package</KEYWORD1>
+ <KEYWORD1>private</KEYWORD1>
+ <KEYWORD1>property</KEYWORD1>
+ <KEYWORD1>protected</KEYWORD1>
+ <KEYWORD1>public</KEYWORD1>
+ <KEYWORD1>resume</KEYWORD1>
+ <KEYWORD1>return</KEYWORD1>
+ <KEYWORD1>self</KEYWORD1>
+ <KEYWORD1>static</KEYWORD1>
+ <KEYWORD1>struct</KEYWORD1>
+ <KEYWORD1>super</KEYWORD1>
+ <KEYWORD1>switch</KEYWORD1>
+ <KEYWORD1>this</KEYWORD1>
+ <KEYWORD1>throw</KEYWORD1>
+ <KEYWORD1>transient</KEYWORD1>
+ <KEYWORD1>true</KEYWORD1>
+ <KEYWORD1>try</KEYWORD1>
+ <KEYWORD1>type</KEYWORD1>
+ <KEYWORD1>val</KEYWORD1>
+ <KEYWORD1>var</KEYWORD1>
+ <KEYWORD1>void</KEYWORD1>
+ <KEYWORD1>when</KEYWORD1>
+ <KEYWORD1>while</KEYWORD1>
+ <KEYWORD1>=&gt;</KEYWORD1>
+
+ <!-- java.lang.* wrapper types -->
+ <KEYWORD2>Character</KEYWORD2>
+ <KEYWORD2>Integer</KEYWORD2>
+
+ <!-- scala.* primitive types -->
+ <KEYWORD2>Boolean</KEYWORD2>
+ <KEYWORD2>Byte</KEYWORD2>
+ <KEYWORD2>Char</KEYWORD2>
+ <KEYWORD2>Double</KEYWORD2>
+ <KEYWORD2>Float</KEYWORD2>
+ <KEYWORD2>Int</KEYWORD2>
+ <KEYWORD2>Long</KEYWORD2>
+ <KEYWORD2>Short</KEYWORD2>
+ <KEYWORD2>Unit</KEYWORD2>
+
+ <!-- scala.* predefined types -->
+ <KEYWORD3>Any</KEYWORD3>
+ <KEYWORD3>AnyRef</KEYWORD3>
+ <KEYWORD3>Nothing</KEYWORD3>
+
+ <LITERAL2>false</LITERAL2>
+ <LITERAL2>null</LITERAL2>
+ <LITERAL2>super</LITERAL2>
+ <LITERAL2>this</LITERAL2>
+ <LITERAL2>true</LITERAL2>
+ </KEYWORDS>
+ </RULES>
+
+ <RULES SET="DOC" DEFAULT="COMMENT3">
+ <KEYWORDS>
+ <LABEL>link</LABEL>
+ <LABEL>linkplain</LABEL>
+ <LABEL>inheritdoc</LABEL>
+ <LABEL>inheritDoc</LABEL>
+ <LABEL>docroot</LABEL>
+ <LABEL>docRoot</LABEL>
+ <LABEL>value</LABEL>
+ </KEYWORDS>
+ </RULES>
+
+ <RULES SET="TYPE_PARAMS" DEFAULT="LITERAL3">
+ <SPAN MATCH_TYPE="LITERAL3" DELEGATE="TYPE_PARAMS">
+ <BEGIN>[</BEGIN>
+ <END>]</END>
+ </SPAN>
+ </RULES>
+
+ <RULES SET="XML_SHARED">
+ <SPAN TYPE="COMMENT2">
+ <BEGIN>&lt;!--</BEGIN>
+ <END>--&gt;</END>
+ </SPAN>
+
+ <SPAN TYPE="LITERAL3">
+ <BEGIN>&lt;?</BEGIN>
+ <END>?&gt;</END>
+ </SPAN>
+
+ <SPAN MATCH_TYPE="LITERAL3" TYPE="COMMENT4">
+ <BEGIN>&lt;![CDATA[</BEGIN>
+ <END>]]&gt;</END>
+ </SPAN>
+
+ <SEQ_REGEXP HASH_CHAR="&lt;" TYPE="LITERAL3">&lt;([\d\w_\-:.]+)(\s+[\d\w_\-:.]+=('[^']*'|"[^"]*"))*\s*/\s*&gt;</SEQ_REGEXP>
+
+ <SPAN_REGEXP DELEGATE="XML_LITERAL" HASH_CHAR="&lt;" MATCH_TYPE="LITERAL3" TYPE="NULL">
+ <BEGIN>&lt;([\d\w_\-:.]+)(\s+[\d\w_\-:.]+=('[^']*'|"[^"]*"))*\s*&gt;</BEGIN>
+ <END>&lt;/$1&gt;</END>
+ </SPAN_REGEXP>
+ </RULES>
+
+ <!-- TODO find a way to highlight attribute names as LABEL, attribute values as LITERAL1 -->
+ <RULES SET="XML_LITERAL" DEFAULT="COMMENT4">
+ <PROPS>
+ <PROPERTY NAME="commentStart" VALUE="&lt;!--" />
+ <PROPERTY NAME="commentEnd" VALUE="--&gt;" />
+ <PROPERTY NAME="lineComment" VALUE="" />
+ </PROPS>
+
+ <IMPORT DELEGATE="XML_SHARED"/>
+
+ <SPAN DELEGATE="MAIN">
+ <BEGIN>{</BEGIN>
+ <END>}</END>
+ </SPAN>
+
+ <SPAN TYPE="LABEL" NO_WORD_BREAK="TRUE">
+ <BEGIN>&amp;</BEGIN>
+ <END>;</END>
+ </SPAN>
+
+ <SEQ_REGEXP HASH_CHAR="&lt;" TYPE="INVALID">&lt;/[\d\w_\-:.]+&gt;</SEQ_REGEXP> <!-- unmatched closing tags -->
+ </RULES>
+</MODE>
+

0 comments on commit 3c81e8c

Please sign in to comment.