PageRenderTime 94ms CodeModel.GetById 72ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
XML | 234 lines | 213 code | 2 blank | 19 comment | 0 complexity | 3ff418afc41e7d75a14901147419e656 MD5 | raw file
  1<?xml version="1.0"?>
  2<!DOCTYPE MODE SYSTEM "xmode.dtd">
  3<!-- Lua 5.0 Mode, written by Philipp Janda -->
  4
  5<!-- TODO:
  6  * Autoindent screws up, if { or ( gets typed after the indentNextLines trigger
  7  -> This is very annoying, so I disabled the automatic indenting in this case!
  8  -> It should be fixed if you set doubleBracketIndent to "true", but I keep it
  9     disabled anyway since it is not that useful if you don't have an unindent!
 10  * Should I use FUNCTION and OPERATOR tags inside of <KEYWORDS>??!!
 11-->
 12
 13<MODE>
 14  <PROPS>
 15    <!-- Comments -->
 16    <PROPERTY NAME="lineComment" VALUE="--"/>
 17    <PROPERTY NAME="commentStart" VALUE="--[["/>
 18    <PROPERTY NAME="commentEnd" VALUE="]]"/>
 19    <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*"/>
 20    <!-- Auto indent -->
 21    <PROPERTY NAME="indentOpenBrackets" VALUE="{"/>
 22    <PROPERTY NAME="indentCloseBrackets" VALUE="}"/>
 23    <!--
 24    <PROPERTY NAME="indentNextLines" VALUE=".*((then|else|do|function)).*"/>
 25    -->
 26    <PROPERTY NAME="doubleBracketIndent" VALUE="true"/>
 27    <PROPERTY NAME="lineUpClosingBracket" VALUE="true"/>
 28  </PROPS>
 29  <RULES IGNORE_CASE="FALSE" NO_WORD_SEP="_:." HIGHLIGHT_DIGITS="TRUE"
 30         DIGIT_RE="[[:digit:]]*(\.[[:digit:]]*)?([eE][+-]?[[:digit:]]*)?">
 31    <!-- Multiline comments -->
 32    <SPAN TYPE="COMMENT1">
 33      <BEGIN>--[[</BEGIN>
 34      <END>]]</END>
 35    </SPAN>
 36    <!-- Single line comments -->
 37    <EOL_SPAN TYPE="COMMENT1">--</EOL_SPAN>
 38    <EOL_SPAN AT_LINE_START="TRUE" TYPE="COMMENT2">#!</EOL_SPAN>
 39    <!-- Simple string literals -->
 40    <SPAN TYPE="LITERAL1">
 41      <BEGIN>"</BEGIN>
 42      <END>"</END>
 43    </SPAN>
 44    <SPAN TYPE="LITERAL1">
 45      <BEGIN>'</BEGIN>
 46      <END>'</END>
 47    </SPAN>
 48    <!-- Multiline string literals -->
 49    <SPAN TYPE="LITERAL1">
 50      <BEGIN>[[</BEGIN>
 51      <END>]]</END>
 52    </SPAN>
 53    <!-- Operators -->
 54    <SEQ TYPE="OPERATOR">+</SEQ>
 55    <SEQ TYPE="OPERATOR">-</SEQ>
 56    <SEQ TYPE="OPERATOR">*</SEQ>
 57    <SEQ TYPE="OPERATOR">/</SEQ>
 58    <SEQ TYPE="OPERATOR">^</SEQ>
 59    <SEQ TYPE="OPERATOR">..</SEQ>
 60    <SEQ TYPE="OPERATOR">&lt;=</SEQ>
 61    <SEQ TYPE="OPERATOR">&lt;</SEQ>
 62    <SEQ TYPE="OPERATOR">&gt;=</SEQ>
 63    <SEQ TYPE="OPERATOR">&gt;</SEQ>
 64    <SEQ TYPE="OPERATOR">==</SEQ>
 65    <SEQ TYPE="OPERATOR">~=</SEQ>
 66    <SEQ TYPE="OPERATOR">=</SEQ>
 67    <!-- Function calls and definitions -->
 68    <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 69    <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">{</MARK_PREVIOUS>
 70    <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">"</MARK_PREVIOUS>
 71    <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">'</MARK_PREVIOUS>
 72    <KEYWORDS>
 73      <!-- Keywords -->
 74      <KEYWORD1>do</KEYWORD1>
 75      <KEYWORD1>end</KEYWORD1>
 76      <KEYWORD1>while</KEYWORD1>
 77      <KEYWORD1>repeat</KEYWORD1>
 78      <KEYWORD1>until</KEYWORD1>
 79      <KEYWORD1>if</KEYWORD1>
 80      <KEYWORD1>then</KEYWORD1>
 81      <KEYWORD1>elseif</KEYWORD1>
 82      <KEYWORD1>else</KEYWORD1>
 83      <KEYWORD1>return</KEYWORD1>
 84      <KEYWORD1>break</KEYWORD1>
 85      <KEYWORD1>for</KEYWORD1>
 86      <KEYWORD1>in</KEYWORD1>
 87      <KEYWORD1>function</KEYWORD1>
 88      <KEYWORD1>local</KEYWORD1>
 89      <KEYWORD3>nil</KEYWORD3>
 90      <KEYWORD3>true</KEYWORD3>
 91      <KEYWORD3>false</KEYWORD3>
 92      <KEYWORD1>and</KEYWORD1>
 93      <KEYWORD1>or</KEYWORD1>
 94      <KEYWORD1>not</KEYWORD1>
 95      <!-- Builtin functions or special names -->
 96      <KEYWORD2>assert</KEYWORD2>
 97      <KEYWORD2>collectgarbage</KEYWORD2>
 98      <KEYWORD2>dofile</KEYWORD2>
 99      <KEYWORD2>error</KEYWORD2>
100      <KEYWORD2>_G</KEYWORD2>
101      <KEYWORD2>getfenv</KEYWORD2>
102      <KEYWORD2>getmetatable</KEYWORD2>
103      <KEYWORD2>gcinfo</KEYWORD2>
104      <KEYWORD2>ipairs</KEYWORD2>
105      <KEYWORD2>loadfile</KEYWORD2>
106      <KEYWORD2>loadlib</KEYWORD2>
107      <KEYWORD2>loadstring</KEYWORD2>
108      <KEYWORD2>next</KEYWORD2>
109      <KEYWORD2>pairs</KEYWORD2>
110      <KEYWORD2>pcall</KEYWORD2>
111      <KEYWORD2>print</KEYWORD2>
112      <KEYWORD2>rawequal</KEYWORD2>
113      <KEYWORD2>rawget</KEYWORD2>
114      <KEYWORD2>rawset</KEYWORD2>
115      <KEYWORD2>require</KEYWORD2>
116      <KEYWORD2>setfenv</KEYWORD2>
117      <KEYWORD2>setmetatable</KEYWORD2>
118      <KEYWORD2>tonumber</KEYWORD2>
119      <KEYWORD2>tostring</KEYWORD2>
120      <KEYWORD2>type</KEYWORD2>
121      <KEYWORD2>unpack</KEYWORD2>
122      <KEYWORD2>xpcall</KEYWORD2>
123      <KEYWORD2>_VERSION</KEYWORD2>
124      <KEYWORD2>LUA_PATH</KEYWORD2>
125      <KEYWORD2>_LOADED</KEYWORD2>
126      <KEYWORD2>_REQUIREDNAME</KEYWORD2>
127      <KEYWORD2>_ALERT</KEYWORD2>
128      <KEYWORD2>_ERRORMESSAGE</KEYWORD2>
129      <KEYWORD2>_PROMPT</KEYWORD2>
130      <KEYWORD2>__add</KEYWORD2>
131      <KEYWORD2>__sub</KEYWORD2>
132      <KEYWORD2>__mul</KEYWORD2>
133      <KEYWORD2>__div</KEYWORD2>
134      <KEYWORD2>__pow</KEYWORD2>
135      <KEYWORD2>__unm</KEYWORD2>
136      <KEYWORD2>__concat</KEYWORD2>
137      <KEYWORD2>__eq</KEYWORD2>
138      <KEYWORD2>__lt</KEYWORD2>
139      <KEYWORD2>__le</KEYWORD2>
140      <KEYWORD2>__index</KEYWORD2>
141      <KEYWORD2>__newindex</KEYWORD2>
142      <KEYWORD2>__call</KEYWORD2>
143      <KEYWORD2>__metatable</KEYWORD2>
144      <KEYWORD2>__mode</KEYWORD2>
145      <KEYWORD2>__tostring</KEYWORD2>
146      <KEYWORD2>__fenv</KEYWORD2>
147      <KEYWORD2>...</KEYWORD2>
148      <KEYWORD2>arg</KEYWORD2>
149      <KEYWORD2>coroutine.create</KEYWORD2>
150      <KEYWORD2>coroutine.resume</KEYWORD2>
151      <KEYWORD2>coroutine.status</KEYWORD2>
152      <KEYWORD2>coroutine.wrap</KEYWORD2>
153      <KEYWORD2>coroutine.yield</KEYWORD2>
154      <KEYWORD2>string.byte</KEYWORD2>
155      <KEYWORD2>string.char</KEYWORD2>
156      <KEYWORD2>string.dump</KEYWORD2>
157      <KEYWORD2>string.find</KEYWORD2>
158      <KEYWORD2>string.len</KEYWORD2>
159      <KEYWORD2>string.lower</KEYWORD2>
160      <KEYWORD2>string.rep</KEYWORD2>
161      <KEYWORD2>string.sub</KEYWORD2>
162      <KEYWORD2>string.upper</KEYWORD2>
163      <KEYWORD2>string.format</KEYWORD2>
164      <KEYWORD2>string.gfind</KEYWORD2>
165      <KEYWORD2>string.gsub</KEYWORD2>
166      <KEYWORD2>table.concat</KEYWORD2>
167      <KEYWORD2>table.foreach</KEYWORD2>
168      <KEYWORD2>table.foreachi</KEYWORD2>
169      <KEYWORD2>table.getn</KEYWORD2>
170      <KEYWORD2>table.sort</KEYWORD2>
171      <KEYWORD2>table.insert</KEYWORD2>
172      <KEYWORD2>table.remove</KEYWORD2>
173      <KEYWORD2>table.setn</KEYWORD2>
174      <KEYWORD2>math.abs</KEYWORD2>
175      <KEYWORD2>math.acos</KEYWORD2>
176      <KEYWORD2>math.asin</KEYWORD2>
177      <KEYWORD2>math.atan</KEYWORD2>
178      <KEYWORD2>math.atan2</KEYWORD2>
179      <KEYWORD2>math.ceil</KEYWORD2>
180      <KEYWORD2>math.cos</KEYWORD2>
181      <KEYWORD2>math.deg</KEYWORD2>
182      <KEYWORD2>math.exp</KEYWORD2>
183      <KEYWORD2>math.floor</KEYWORD2>
184      <KEYWORD2>math.log</KEYWORD2>
185      <KEYWORD2>math.log10</KEYWORD2>
186      <KEYWORD2>math.max</KEYWORD2>
187      <KEYWORD2>math.min</KEYWORD2>
188      <KEYWORD2>math.mod</KEYWORD2>
189      <KEYWORD2>math.pow</KEYWORD2>
190      <KEYWORD2>math.rad</KEYWORD2>
191      <KEYWORD2>math.sin</KEYWORD2>
192      <KEYWORD2>math.sqrt</KEYWORD2>
193      <KEYWORD2>math.tan</KEYWORD2>
194      <KEYWORD2>math.frexp</KEYWORD2>
195      <KEYWORD2>math.ldexp</KEYWORD2>
196      <KEYWORD2>math.random</KEYWORD2>
197      <KEYWORD2>math.randomseed</KEYWORD2>
198      <KEYWORD2>math.pi</KEYWORD2>
199      <KEYWORD2>io.close</KEYWORD2>
200      <KEYWORD2>io.flush</KEYWORD2>
201      <KEYWORD2>io.input</KEYWORD2>
202      <KEYWORD2>io.lines</KEYWORD2>
203      <KEYWORD2>io.open</KEYWORD2>
204      <KEYWORD2>io.read</KEYWORD2>
205      <KEYWORD2>io.tmpfile</KEYWORD2>
206      <KEYWORD2>io.type</KEYWORD2>
207      <KEYWORD2>io.write</KEYWORD2>
208      <KEYWORD2>io.stdin</KEYWORD2>
209      <KEYWORD2>io.stdout</KEYWORD2>
210      <KEYWORD2>io.stderr</KEYWORD2>
211      <KEYWORD2>os.clock</KEYWORD2>
212      <KEYWORD2>os.date</KEYWORD2>
213      <KEYWORD2>os.difftime</KEYWORD2>
214      <KEYWORD2>os.execute</KEYWORD2>
215      <KEYWORD2>os.exit</KEYWORD2>
216      <KEYWORD2>os.getenv</KEYWORD2>
217      <KEYWORD2>os.remove</KEYWORD2>
218      <KEYWORD2>os.rename</KEYWORD2>
219      <KEYWORD2>os.setlocale</KEYWORD2>
220      <KEYWORD2>os.time</KEYWORD2>
221      <KEYWORD2>os.tmpname</KEYWORD2>
222      <KEYWORD2>debug.debug</KEYWORD2>
223      <KEYWORD2>debug.gethook</KEYWORD2>
224      <KEYWORD2>debug.getinfo</KEYWORD2>
225      <KEYWORD2>debug.getlocal</KEYWORD2>
226      <KEYWORD2>debug.getupvalue</KEYWORD2>
227      <KEYWORD2>debug.setlocal</KEYWORD2>
228      <KEYWORD2>debug.setupvalue</KEYWORD2>
229      <KEYWORD2>debug.sethook</KEYWORD2>
230      <KEYWORD2>debug.traceback</KEYWORD2>
231    </KEYWORDS>
232  </RULES>
233</MODE>
234