PageRenderTime 56ms CodeModel.GetById 48ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 1ms

/jEdit/tags/jedit-4-2-pre14/modes/pike.xml

#
XML | 242 lines | 175 code | 28 blank | 39 comment | 0 complexity | f09a14d8abc0c9a0bb32ff474278b718 MD5 | raw file
  1<?xml version="1.0"?>
  2
  3<!-- Pike mode, contributed by 
  4                      Marco G?tze, <gomar@gmx.net> -->
  5<!-- Small fixes and autodoc support contributed by 
  6                      Peter Lundqvist <peterl@update.uu.se> -->
  7
  8<!DOCTYPE MODE SYSTEM "xmode.dtd">
  9
 10<MODE>
 11  <PROPS>
 12    <PROPERTY NAME="commentStart" VALUE="/*"/>
 13    <PROPERTY NAME="commentEnd" VALUE="*/"/>
 14    <PROPERTY NAME="lineComment" VALUE="//"/>
 15    <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*`"/>
 16
 17    <!-- Auto indent -->
 18    <PROPERTY NAME="indentOpenBrackets" VALUE="{"/>
 19    <PROPERTY NAME="indentCloseBrackets" VALUE="}"/>
 20    <PROPERTY NAME="indentNextLine" VALUE="\s*(((if|(for(each)?)|while|catch|gauge)\s*\(|(do|else)\s*|else\s+if\s*\()[^{;]*)"/>
 21    <!-- set this to 'true' if you want to use GNU coding style -->
 22    <PROPERTY NAME="doubleBracketIndent" VALUE="false"/>
 23    <PROPERTY NAME="lineUpClosingBracket" VALUE="true"/>
 24  </PROPS>
 25  <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="(0x[[:xdigit:]]+|[[:digit]]+|0[bB][01]+)[lLdDfF]?">
 26
 27    <!-- comments -->
 28    <SPAN TYPE="COMMENT1" DELEGATE="COMMENT">
 29      <BEGIN>/*</BEGIN>
 30      <END>*/</END>
 31    </SPAN>
 32    <SEQ TYPE="INVALID">*/</SEQ>
 33
 34    <!-- Autodoc comment -->
 35    <EOL_SPAN TYPE="COMMENT1" DELEGATE="AUTODOC">//!</EOL_SPAN>
 36    <!-- C++ line comment -->
 37    <EOL_SPAN TYPE="COMMENT1" DELEGATE="COMMENT">//</EOL_SPAN>
 38
 39    <!-- string, char literals -->
 40    <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" DELEGATE="STRING_LITERAL">
 41      <BEGIN>"</BEGIN>
 42      <END>"</END>
 43    </SPAN>
 44    <SPAN TYPE="LITERAL1" DELEGATE="STRING_LITERAL">
 45      <BEGIN>#"</BEGIN>
 46      <END>"</END>
 47    </SPAN>
 48    <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 49      <BEGIN>'</BEGIN>
 50      <END>'</END>
 51    </SPAN>
 52
 53    <!-- preprocessor statements -->
 54    <SEQ_REGEXP TYPE="KEYWORD2" HASH_CHAR="#" AT_LINE_START="TRUE">#.*?(?=($|/\*|//))</SEQ_REGEXP>
 55
 56    <!-- operators -->
 57    <SEQ TYPE="OPERATOR">({</SEQ>
 58    <SEQ TYPE="OPERATOR">})</SEQ>
 59    <SEQ TYPE="OPERATOR">([</SEQ>
 60    <SEQ TYPE="OPERATOR">])</SEQ>
 61    <SEQ TYPE="OPERATOR">(&lt;</SEQ>
 62    <SEQ TYPE="OPERATOR">&gt;)</SEQ>
 63    <SEQ TYPE="OPERATOR">=</SEQ>
 64    <SEQ TYPE="OPERATOR">!</SEQ>
 65    <SEQ TYPE="OPERATOR">+</SEQ>
 66    <SEQ TYPE="OPERATOR">-</SEQ>
 67    <SEQ TYPE="OPERATOR">/</SEQ>
 68    <SEQ TYPE="OPERATOR">*</SEQ>
 69    <SEQ TYPE="OPERATOR">&gt;</SEQ>
 70    <SEQ TYPE="OPERATOR">&lt;</SEQ>
 71    <SEQ TYPE="OPERATOR">%</SEQ>
 72    <SEQ TYPE="OPERATOR">&amp;</SEQ>
 73    <SEQ TYPE="OPERATOR">|</SEQ>
 74    <SEQ TYPE="OPERATOR">^</SEQ>
 75    <SEQ TYPE="OPERATOR">~</SEQ>
 76    <SEQ TYPE="OPERATOR">@</SEQ>
 77    <SEQ TYPE="OPERATOR">`</SEQ>
 78    <SEQ TYPE="OPERATOR">.</SEQ>
 79
 80    <!-- function calls -->
 81    <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 82
 83    <KEYWORDS>
 84      <!-- type modifiers -->
 85      <KEYWORD1>constant</KEYWORD1>
 86      <KEYWORD1>extern</KEYWORD1>
 87      <KEYWORD1>final</KEYWORD1>
 88      <KEYWORD1>inline</KEYWORD1>
 89      <KEYWORD1>local</KEYWORD1>
 90      <KEYWORD1>nomask</KEYWORD1>
 91      <KEYWORD1>optional</KEYWORD1>
 92      <KEYWORD1>private</KEYWORD1>
 93      <KEYWORD1>protected</KEYWORD1>
 94      <KEYWORD1>public</KEYWORD1>
 95      <KEYWORD1>static</KEYWORD1>
 96      <KEYWORD1>variant</KEYWORD1>
 97
 98      <!-- types -->
 99      <KEYWORD3>array</KEYWORD3>
100      <KEYWORD3>class</KEYWORD3>
101      <KEYWORD3>float</KEYWORD3>
102      <KEYWORD3>function</KEYWORD3>
103      <KEYWORD3>int</KEYWORD3>
104      <KEYWORD3>mapping</KEYWORD3>
105      <KEYWORD3>mixed</KEYWORD3>
106      <KEYWORD3>multiset</KEYWORD3>
107      <KEYWORD3>object</KEYWORD3>
108      <KEYWORD3>program</KEYWORD3>
109      <KEYWORD3>string</KEYWORD3>
110      <KEYWORD3>void</KEYWORD3>
111
112      <!-- flow control and block-introducing keywords -->
113      <KEYWORD1>break</KEYWORD1>
114      <KEYWORD1>case</KEYWORD1>
115      <KEYWORD1>catch</KEYWORD1>
116      <KEYWORD1>continue</KEYWORD1>
117      <KEYWORD1>default</KEYWORD1>
118      <KEYWORD1>do</KEYWORD1>
119      <KEYWORD1>else</KEYWORD1>
120      <KEYWORD1>for</KEYWORD1>
121      <KEYWORD1>foreach</KEYWORD1>
122      <KEYWORD1>gauge</KEYWORD1>
123      <KEYWORD1>if</KEYWORD1>
124      <KEYWORD1>lambda</KEYWORD1>
125      <KEYWORD1>return</KEYWORD1>
126      <KEYWORD1>sscanf</KEYWORD1>
127      <KEYWORD1>switch</KEYWORD1>
128      <KEYWORD1>while</KEYWORD1>
129
130      <!-- special instructions -->
131      <KEYWORD2>import</KEYWORD2>
132      <KEYWORD2>inherit</KEYWORD2>
133    </KEYWORDS>
134  </RULES>
135
136  <RULES SET="COMMENT" IGNORE_CASE="FALSE" DEFAULT="COMMENT1">
137    <KEYWORDS>
138      <COMMENT2>FIXME</COMMENT2>
139      <COMMENT2>XXX</COMMENT2>
140    </KEYWORDS>
141  </RULES>
142
143  <RULES SET="AUTODOC" IGNORE_CASE="TRUE" DEFAULT="COMMENT1">
144		
145		<EOL_SPAN TYPE="NULL" DELEGATE="MAIN" EXCLUDE_MATCH="TRUE">@decl</EOL_SPAN>
146		
147		<!-- XML tags -->
148		<SPAN TYPE="MARKUP" DELEGATE="xml::TAGS">
149		  <BEGIN>@xml{</BEGIN>
150			<END>@}</END>
151		</SPAN>
152		<!-- Cross references -->
153		<SPAN TYPE="FUNCTION" NO_LINE_BREAK="TRUE">
154  		<BEGIN>@[</BEGIN>
155			<END>]</END>
156		</SPAN>
157			
158		<!-- Brace keywords -->
159		<SEQ_REGEXP TYPE="FUNCTION" HASH_CHAR="@">@(b|i|u|tt|url|pre|ref|code|expr|image)?(\{.*@\})</SEQ_REGEXP>
160				
161		<KEYWORDS>
162		  <!-- Meta keywords -->
163		  <LABEL>@appears</LABEL>
164		  <LABEL>@belongs</LABEL>
165		  <LABEL>@class</LABEL>
166		  <LABEL>@endclass</LABEL>
167		  <LABEL>@example</LABEL>
168		  <LABEL>@module</LABEL>
169		  <LABEL>@endmodule</LABEL>
170		  <LABEL>@namespace</LABEL>
171		  <LABEL>@endnamespace</LABEL>
172		  <!-- <LABEL>@decl</LABEL> 
173		  -->
174		  
175		  <!-- Single keywords -->
176		  <LABEL>@deprecated</LABEL>
177		  
178		  <!-- Delimiter keywords -->
179		  <LABEL>@note</LABEL>
180		  <LABEL>@example</LABEL>
181		  <LABEL>@bugs</LABEL>
182		  <LABEL>@returns</LABEL>
183		  <LABEL>@throws</LABEL>
184		  <LABEL>@param</LABEL>
185		  <LABEL>@seealso</LABEL>
186		  <LABEL>@fixme</LABEL>
187		  <LABEL>@constant</LABEL>
188		  <LABEL>@member</LABEL>
189		  <LABEL>@index</LABEL>
190		  <LABEL>@elem</LABEL>
191		  <LABEL>@value</LABEL>
192		  <LABEL>@type</LABEL>
193		  <LABEL>@item</LABEL>
194		  
195		  <!-- Container keywords -->
196		  <LABEL>@section</LABEL>
197		  <LABEL>@mapping</LABEL>
198		  <LABEL>@endmapping</LABEL>
199		  <LABEL>@multiset</LABEL>
200		  <LABEL>@endmultiset</LABEL>
201		  <LABEL>@array</LABEL>
202		  <LABEL>@endarray</LABEL>
203		  <LABEL>@int</LABEL>
204		  <LABEL>@endint</LABEL>
205		  <LABEL>@string</LABEL>
206		  <LABEL>@endstring</LABEL>
207		  <LABEL>@mixed</LABEL>
208		  <LABEL>@endmixed</LABEL>
209		  <LABEL>@dl</LABEL>
210		  <LABEL>@enddl</LABEL>
211		  <LABEL>@ol</LABEL>
212		  <LABEL>@endol</LABEL>
213		  <LABEL>@ul</LABEL>
214		  <LABEL>@endol</LABEL>
215		  
216		  <!-- Special keywords -->
217		  <LABEL>@ignore</LABEL>
218		  <LABEL>@endignore</LABEL>
219		  
220		</KEYWORDS>
221		
222		<!-- Attempt to get syntax highlighting of @decl-ed functions 
223		     inside of the autodoc-rule. 
224				 
225		     It works - but jEdit 4.1 has problems keeping it highlighted 
226		     (the syntax highlighting works depending on how you travel
227		     past the @decl-ed region).
228		     Can't figure aout how to to proper coloring of the @decl
229		     keyword either.
230		     
231		     If there are problems with what regions are highlighted - 
232		     try to uncomment this first.
233		-->
234		<EOL_SPAN TYPE="NULL" DELEGATE="MAIN">@decl</EOL_SPAN>
235		
236	</RULES>
237	
238  <RULES SET="STRING_LITERAL" ESCAPE="\" IGNORE_CASE="TRUE" DEFAULT="LITERAL1">
239    <SEQ_REGEXP TYPE="LITERAL2" HASH_CHAR="%">%([^ a-z]*[a-z]|\[[^\]]*\])</SEQ_REGEXP>
240    <SEQ_REGEXP TYPE="COMMENT2" HASH_CHAR="D">DEBUG:</SEQ_REGEXP>
241  </RULES>
242</MODE>