| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY HEX "[0-9A-Fa-f]"> |
| 5 |
]> |
| 6 |
<!-- |
| 7 |
LUA (www.lua.org) syntax highlighting for Kate |
| 8 |
|
| 9 |
CHANGES |
| 10 |
|
| 11 |
[ Version 1.05 (2019-06-03) by Jonathan Poelen ] |
| 12 |
|
| 13 |
- warn and coroutine.kill (Lua 5.4) |
| 14 |
- end of a function as Keyword rather than Control |
| 15 |
|
| 16 |
[ Version 1.04 (2018-04-30) by Jonathan Poelen ] |
| 17 |
|
| 18 |
- based on Lua 5.3 |
| 19 |
- some math.*, table.* and string.* are marked as deprecated |
| 20 |
- fix special char, float format and ' collapsable |
| 21 |
|
| 22 |
[ Version 1.03 (2007-09-12) by Bruno Massa ] |
| 23 |
|
| 24 |
- [=[ ]=] comment and string style is now working (thanks to Dominik and Sebastian) |
| 25 |
- it uses DoxygenLua.xml to format the comments in a Doxygen style |
| 26 |
|
| 27 |
[ Version 1.02 (2007-07-15) by Bruno Massa ] |
| 28 |
|
| 29 |
- based on Lua 5.1 |
| 30 |
- highlight the Kepler function (cgilua, luasql, lfs, luazip) |
| 31 |
- true, false and nil are highlighted in black |
| 32 |
- table.foreach and foreachi are marked as alerts |
| 33 |
|
| 34 |
[ Version 1.01 (2007-01-01) by Bruno Massa ] |
| 35 |
|
| 36 |
- highlighting similar to PHP |
| 37 |
- error detection on one-line strings and common mistakes from other languages like using "!=" "++" |
| 38 |
- uppercase-only variables are highlighted as constants |
| 39 |
- { } now is collapsable |
| 40 |
|
| 41 |
[ Version 1.00 (2006-12-05) by Bruno Massa ] |
| 42 |
|
| 43 |
- based on Lua 5.0.2 syntax |
| 44 |
- strings "[[ ]]" and single quoted strings |
| 45 |
- block comments |
| 46 |
- function, if/elseif/else, do-end chunks, comment blocks, strings using [[ ]] collapsable |
| 47 |
- nil, false and true consided pseudo-variables (displayed as numbers) |
| 48 |
- NOTE, FIXME, TODO alerts added on comments |
| 49 |
- improved highlighting |
| 50 |
--> |
| 51 |
<language name="Lua" version="18" indenter="lua" kateversion="5.79" section="Scripts" extensions="*.lua;*.rockspec" mimetype="text/x-lua"> |
| 52 |
<highlighting> |
| 53 |
<list name="keywords"> |
| 54 |
<item>and</item> |
| 55 |
<item>function</item> |
| 56 |
<item>in</item> |
| 57 |
<item>local</item> |
| 58 |
<item>not</item> |
| 59 |
<item>or</item> |
| 60 |
</list> |
| 61 |
|
| 62 |
<list name="specialvars"> |
| 63 |
<item>nil</item> |
| 64 |
<item>false</item> |
| 65 |
<item>true</item> |
| 66 |
</list> |
| 67 |
|
| 68 |
<list name="control"> |
| 69 |
<item>break</item> |
| 70 |
<item>do</item> |
| 71 |
<item>else</item> |
| 72 |
<item>elseif</item> |
| 73 |
<item>end</item> |
| 74 |
<item>for</item> |
| 75 |
<item>goto</item> |
| 76 |
<item>if</item> |
| 77 |
<item>repeat</item> |
| 78 |
<item>return</item> |
| 79 |
<item>then</item> |
| 80 |
<item>until</item> |
| 81 |
<item>while</item> |
| 82 |
</list> |
| 83 |
|
| 84 |
<list name="startcontrol"> |
| 85 |
<item>do</item> |
| 86 |
<item>if</item> |
| 87 |
<item>repeat</item> |
| 88 |
</list> |
| 89 |
|
| 90 |
<list name="elsecontrol"> |
| 91 |
<item>else</item> |
| 92 |
<item>elseif</item> |
| 93 |
</list> |
| 94 |
|
| 95 |
<list name="endcontrol"> |
| 96 |
<item>end</item> |
| 97 |
<item>until</item> |
| 98 |
</list> |
| 99 |
|
| 100 |
<list name="basevar"> |
| 101 |
<item>_PROMPT</item> |
| 102 |
<item>_PROMPT2</item> |
| 103 |
<item>LUA_PATH</item> |
| 104 |
<item>LUA_CPATH</item> |
| 105 |
<item>LUA_INIT</item> |
| 106 |
<item>_ENV</item> |
| 107 |
<item>_VERSION</item> |
| 108 |
<item>_G</item> |
| 109 |
<!-- Module --> |
| 110 |
<item>package.config</item> |
| 111 |
<item>package.cpath</item> |
| 112 |
<item>package.loaded</item> |
| 113 |
<item>package.path</item> |
| 114 |
<item>package.preload</item> |
| 115 |
<item>package.searchers</item> |
| 116 |
<!-- UTF-8 Support --> |
| 117 |
<item>utf8.charpattern</item> |
| 118 |
<!-- Mathematical Functions --> |
| 119 |
<item>math.maxinteger</item> |
| 120 |
<item>math.mininteger</item> |
| 121 |
<item>math.pi</item> |
| 122 |
</list> |
| 123 |
|
| 124 |
<list name="basefunc"> |
| 125 |
<!-- Basic functions --> |
| 126 |
<item>assert</item> |
| 127 |
<item>collectgarbage</item> |
| 128 |
<item>dofile</item> |
| 129 |
<item>error</item> |
| 130 |
<item>getmetatable</item> |
| 131 |
<item>ipairs</item> |
| 132 |
<item>load</item> |
| 133 |
<item>loadfile</item> |
| 134 |
<item>next</item> |
| 135 |
<item>pairs</item> |
| 136 |
<item>pcall</item> |
| 137 |
<item>print</item> |
| 138 |
<item>rawequal</item> |
| 139 |
<item>rawget</item> |
| 140 |
<item>rawlen</item> |
| 141 |
<item>rawset</item> |
| 142 |
<item>select</item> |
| 143 |
<item>setmetatable</item> |
| 144 |
<item>tonumber</item> |
| 145 |
<item>tostring</item> |
| 146 |
<item>type</item> |
| 147 |
<item>warn</item> |
| 148 |
<item>xpcall</item> |
| 149 |
|
| 150 |
<!-- Coroutine manipulation --> |
| 151 |
<item>coroutine.create</item> |
| 152 |
<item>coroutine.isyieldable</item> |
| 153 |
<item>coroutine.resume</item> |
| 154 |
<item>coroutine.close</item> |
| 155 |
<item>coroutine.running</item> |
| 156 |
<item>coroutine.status</item> |
| 157 |
<item>coroutine.wrap</item> |
| 158 |
<item>coroutine.yield</item> |
| 159 |
|
| 160 |
<!-- Module --> |
| 161 |
<item>require</item> |
| 162 |
<item>package.loadlib</item> |
| 163 |
<item>package.searchpath</item> |
| 164 |
|
| 165 |
<!-- String Manipulation --> |
| 166 |
<item>string.byte</item> |
| 167 |
<item>string.char</item> |
| 168 |
<item>string.dump</item> |
| 169 |
<item>string.find</item> |
| 170 |
<item>string.format</item> |
| 171 |
<item>string.gmatch</item> |
| 172 |
<item>string.gsub</item> |
| 173 |
<item>string.len</item> |
| 174 |
<item>string.lower</item> |
| 175 |
<item>string.match</item> |
| 176 |
<item>string.pack</item> |
| 177 |
<item>string.packsize</item> |
| 178 |
<item>string.rep</item> |
| 179 |
<item>string.reverse</item> |
| 180 |
<item>string.sub</item> |
| 181 |
<item>string.unpack</item> |
| 182 |
<item>string.upper</item> |
| 183 |
|
| 184 |
<!-- UTF-8 Support --> |
| 185 |
<item>utf8.char</item> |
| 186 |
<item>utf8.codes</item> |
| 187 |
<item>utf8.codepoint</item> |
| 188 |
<item>utf8.len</item> |
| 189 |
<item>utf8.offset</item> |
| 190 |
|
| 191 |
<!-- Table Manipulation --> |
| 192 |
<item>table.concat</item> |
| 193 |
<item>table.insert</item> |
| 194 |
<item>table.move</item> |
| 195 |
<item>table.pack</item> |
| 196 |
<item>table.remove</item> |
| 197 |
<item>table.sort</item> |
| 198 |
<item>table.unpack</item> |
| 199 |
|
| 200 |
<!-- Mathematical Functions --> |
| 201 |
<item>math.abs</item> |
| 202 |
<item>math.acos</item> |
| 203 |
<item>math.asin</item> |
| 204 |
<item>math.atan</item> |
| 205 |
<item>math.ceil</item> |
| 206 |
<item>math.cos</item> |
| 207 |
<item>math.deg</item> |
| 208 |
<item>math.exp</item> |
| 209 |
<item>math.floor</item> |
| 210 |
<item>math.fmod</item> |
| 211 |
<item>math.huge</item> |
| 212 |
<item>math.log</item> |
| 213 |
<item>math.max</item> |
| 214 |
<item>math.min</item> |
| 215 |
<item>math.modf</item> |
| 216 |
<item>math.rad</item> |
| 217 |
<item>math.random</item> |
| 218 |
<item>math.randomseed</item> |
| 219 |
<item>math.sin</item> |
| 220 |
<item>math.sqrt</item> |
| 221 |
<item>math.tan</item> |
| 222 |
<item>math.tointeger</item> |
| 223 |
<item>math.type</item> |
| 224 |
<item>math.utl</item> |
| 225 |
|
| 226 |
<!-- Input and Output Facilities --> |
| 227 |
<item>io.close</item> |
| 228 |
<item>io.flush</item> |
| 229 |
<item>io.input</item> |
| 230 |
<item>io.lines</item> |
| 231 |
<item>io.open</item> |
| 232 |
<item>io.output</item> |
| 233 |
<item>io.popen</item> |
| 234 |
<item>io.read</item> |
| 235 |
<item>io.stderr</item> |
| 236 |
<item>io.stdin</item> |
| 237 |
<item>io.stdout</item> |
| 238 |
<item>io.tmpfile</item> |
| 239 |
<item>io.type</item> |
| 240 |
<item>io.write</item> |
| 241 |
|
| 242 |
<!-- Operating System Facilities --> |
| 243 |
<item>os.clock</item> |
| 244 |
<item>os.date</item> |
| 245 |
<item>os.difftime</item> |
| 246 |
<item>os.execute</item> |
| 247 |
<item>os.exit</item> |
| 248 |
<item>os.getenv</item> |
| 249 |
<item>os.remove</item> |
| 250 |
<item>os.rename</item> |
| 251 |
<item>os.setlocale</item> |
| 252 |
<item>os.time</item> |
| 253 |
<item>os.tmpname</item> |
| 254 |
|
| 255 |
<!-- The Debug Library --> |
| 256 |
<item>debug.debug</item> |
| 257 |
<item>debug.gethook</item> |
| 258 |
<item>debug.getinfo</item> |
| 259 |
<item>debug.getlocal</item> |
| 260 |
<item>debug.getmetatable</item> |
| 261 |
<item>debug.getregistry</item> |
| 262 |
<item>debug.getupvalue</item> |
| 263 |
<item>debug.getuservalue</item> |
| 264 |
<item>debug.sethook</item> |
| 265 |
<item>debug.setlocal</item> |
| 266 |
<item>debug.setmetatable</item> |
| 267 |
<item>debug.setupvalue</item> |
| 268 |
<item>debug.setuservalue</item> |
| 269 |
<item>debug.traceback</item> |
| 270 |
<item>debug.upvalueid</item> |
| 271 |
<item>debug.upvaluejoin</item> |
| 272 |
|
| 273 |
<item>cgilua</item> |
| 274 |
<item>cgilua.addclosefunction</item> |
| 275 |
<item>cgilua.addopenfunction</item> |
| 276 |
<item>cgilua.addopenfunction</item> |
| 277 |
<item>cgilua.addscripthandler</item> |
| 278 |
<item>cgilua.addscripthandler</item> |
| 279 |
<item>cgilua.buildprocesshandler</item> |
| 280 |
<item>cgilua.contentheader</item> |
| 281 |
<item>cgilua.cookies.delete</item> |
| 282 |
<item>cgilua.cookies.get</item> |
| 283 |
<item>cgilua.cookies.set</item> |
| 284 |
<item>cgilua.cookies.sethtml</item> |
| 285 |
<item>cgilua.cookies</item> |
| 286 |
<item>cgilua.doif</item> |
| 287 |
<item>cgilua.doscript</item> |
| 288 |
<item>cgilua.errorlog</item> |
| 289 |
<item>cgilua.handlelp</item> |
| 290 |
<item>cgilua.header</item> |
| 291 |
<item>cgilua.htmlheader</item> |
| 292 |
<item>cgilua.lp.compile</item> |
| 293 |
<item>cgilua.lp.include</item> |
| 294 |
<item>cgilua.lp.setcompatmode</item> |
| 295 |
<item>cgilua.lp.setoutfunc</item> |
| 296 |
<item>cgilua.lp.translate</item> |
| 297 |
<item>cgilua.mkabsoluteurl</item> |
| 298 |
<item>cgilua.mkurlpath</item> |
| 299 |
<item>cgilua.pack</item> |
| 300 |
<item>cgilua.put</item> |
| 301 |
<item>cgilua.redirect</item> |
| 302 |
<item>cgilua.script_file</item> |
| 303 |
<item>cgilua.script_path</item> |
| 304 |
<item>cgilua.script_pdir</item> |
| 305 |
<item>cgilua.script_vdir</item> |
| 306 |
<item>cgilua.script_vpath</item> |
| 307 |
<item>cgilua.serialize</item> |
| 308 |
<item>cgilua.servervariable</item> |
| 309 |
<item>cgilua.session.close</item> |
| 310 |
<item>cgilua.session.data</item> |
| 311 |
<item>cgilua.session.delete</item> |
| 312 |
<item>cgilua.session.load</item> |
| 313 |
<item>cgilua.session.new</item> |
| 314 |
<item>cgilua.session.open</item> |
| 315 |
<item>cgilua.session.save</item> |
| 316 |
<item>cgilua.session.setsessiondir</item> |
| 317 |
<item>cgilua.session</item> |
| 318 |
<item>cgilua.seterrorhandler</item> |
| 319 |
<item>cgilua.seterroroutput</item> |
| 320 |
<item>cgilua.setmaxfilesize</item> |
| 321 |
<item>cgilua.setmaxinput</item> |
| 322 |
<item>cgilua.setoutfunc</item> |
| 323 |
<item>cgilua.splitpath</item> |
| 324 |
<item>cgilua.urlcode.encodetable</item> |
| 325 |
<item>cgilua.urlcode.escape</item> |
| 326 |
<item>cgilua.urlcode.insertfield</item> |
| 327 |
<item>cgilua.urlcode.parsequery</item> |
| 328 |
<item>cgilua.urlcode.unescape</item> |
| 329 |
<item>cgilua.urlpath</item> |
| 330 |
|
| 331 |
<item>lfs</item> |
| 332 |
<item>lfs.attributes</item> |
| 333 |
<item>lfs.chdir</item> |
| 334 |
<item>lfs.currentdir</item> |
| 335 |
<item>lfs.dir</item> |
| 336 |
<item>lfs.lock</item> |
| 337 |
<item>lfs.mkdir</item> |
| 338 |
<item>lfs.rmdir</item> |
| 339 |
<item>lfs.touch</item> |
| 340 |
<item>lfs.unlock</item> |
| 341 |
|
| 342 |
<item>zip</item> |
| 343 |
<item>zip.open</item> |
| 344 |
<item>zip.openfile</item> |
| 345 |
|
| 346 |
<!-- member function--> |
| 347 |
|
| 348 |
<!-- String Manipulation --> |
| 349 |
<item>byte</item> |
| 350 |
<item>char</item> |
| 351 |
<item>dump</item> |
| 352 |
<item>find</item> |
| 353 |
<item>format</item> |
| 354 |
<item>gmatch</item> |
| 355 |
<item>gsub</item> |
| 356 |
<item>len</item> |
| 357 |
<item>lower</item> |
| 358 |
<item>match</item> |
| 359 |
<item>pack</item> |
| 360 |
<item>packsize</item> |
| 361 |
<item>rep</item> |
| 362 |
<item>reverse</item> |
| 363 |
<item>sub</item> |
| 364 |
<item>unpack</item> |
| 365 |
<item>upper</item> |
| 366 |
|
| 367 |
<!-- Table Manipulation --> |
| 368 |
<item>concat</item> |
| 369 |
<item>insert</item> |
| 370 |
<item>move</item> |
| 371 |
<item>pack</item> |
| 372 |
<item>remove</item> |
| 373 |
<item>sort</item> |
| 374 |
<item>unpack</item> |
| 375 |
|
| 376 |
<!-- luasql --> |
| 377 |
<item>close</item> |
| 378 |
<item>commit</item> |
| 379 |
<item>connect</item> |
| 380 |
<item>escape</item> |
| 381 |
<item>execute</item> |
| 382 |
<item>fetch</item> |
| 383 |
<item>getcolnames</item> |
| 384 |
<item>getcoltypes</item> |
| 385 |
<item>getlastautoid</item> |
| 386 |
<item>numrows</item> |
| 387 |
<item>rollback</item> |
| 388 |
<item>setautocommit</item> |
| 389 |
|
| 390 |
<!-- luazip --> |
| 391 |
<item>files</item> |
| 392 |
|
| 393 |
<!-- File Manipulation --> |
| 394 |
<item>close</item> |
| 395 |
<item>flush</item> |
| 396 |
<item>lines</item> |
| 397 |
<item>read</item> |
| 398 |
<item>seek</item> |
| 399 |
<item>setvbuf</item> |
| 400 |
<item>write</item> |
| 401 |
</list> |
| 402 |
|
| 403 |
<list name="metamethod"> |
| 404 |
<item>__add</item> |
| 405 |
<item>__sub</item> |
| 406 |
<item>__mul</item> |
| 407 |
<item>__div</item> |
| 408 |
<item>__mod</item> |
| 409 |
<item>__pow</item> |
| 410 |
<item>__unm</item> |
| 411 |
<item>__idiv</item> |
| 412 |
<item>__band</item> |
| 413 |
<item>__bor</item> |
| 414 |
<item>__bxor</item> |
| 415 |
<item>__bnot</item> |
| 416 |
<item>__shl</item> |
| 417 |
<item>__shr</item> |
| 418 |
<item>__concat</item> |
| 419 |
<item>__len</item> |
| 420 |
<item>__eq</item> |
| 421 |
<item>__lt</item> |
| 422 |
<item>__le</item> |
| 423 |
<item>__index</item> |
| 424 |
<item>__newindex</item> |
| 425 |
<item>__call</item> |
| 426 |
|
| 427 |
<item>__tostring</item> |
| 428 |
<item>__name</item> |
| 429 |
<item>__close</item> |
| 430 |
<item>__pairs</item> |
| 431 |
<!-- setmetatable --> |
| 432 |
<item>__metatable</item> |
| 433 |
<!-- Garbage collector --> |
| 434 |
<item>__gc</item> |
| 435 |
<!-- Weak table --> |
| 436 |
<item>__mode</item> |
| 437 |
</list> |
| 438 |
|
| 439 |
<list name="deprecated"> |
| 440 |
<item>_ALERT</item> |
| 441 |
<item>_ERRORMESSAGE</item> |
| 442 |
<item>_LOADED</item> |
| 443 |
<item>__ipairs</item> |
| 444 |
<item>foreach</item> |
| 445 |
<item>foreachi</item> |
| 446 |
<item>loadstring</item> |
| 447 |
<item>math.atan2</item> |
| 448 |
<item>math.cosh</item> |
| 449 |
<item>math.frexp</item> |
| 450 |
<item>math.ldexp</item> |
| 451 |
<item>math.log10</item> |
| 452 |
<item>math.mod</item> |
| 453 |
<item>math.pow</item> |
| 454 |
<item>math.sinh</item> |
| 455 |
<item>math.tanh</item> |
| 456 |
<item>string.gfind</item> |
| 457 |
<item>table.foreach</item> |
| 458 |
<item>table.foreachi</item> |
| 459 |
<item>table.getn</item> |
| 460 |
<item>table.setn</item> |
| 461 |
</list> |
| 462 |
|
| 463 |
<contexts> |
| 464 |
<context name="Normal" attribute="Normal Text" lineEndContext="#stay"> |
| 465 |
<Detect2Chars attribute="Comment" context="ShebangLine" char="#" char1="!" column="0"/> |
| 466 |
|
| 467 |
<DetectSpaces /> |
| 468 |
<keyword attribute="Deprecated" context="#stay" String="deprecated" /> |
| 469 |
<Detect2Chars attribute="Comment" context="MatchComment" char="-" char1="-" lookAhead="true"/> |
| 470 |
|
| 471 |
<RegExpr attribute="RawStrings" context="String_block" String="\[(=*)\[" /> |
| 472 |
<DetectChar attribute="Strings" context="String_single" char="'"/> |
| 473 |
<DetectChar attribute="Strings" context="String_double" char="""/> |
| 474 |
<keyword attribute="BFunc" context="#stay" String="basefunc"/> |
| 475 |
<keyword attribute="Metamethod" context="#stay" String="metamethod"/> |
| 476 |
<keyword attribute="BVar" context="#stay" String="basevar"/> |
| 477 |
|
| 478 |
<WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> |
| 479 |
<WordDetect attribute="Keyword" context="Local" String="local" /> |
| 480 |
<keyword attribute="Keyword" context="#stay" String="keywords" /> |
| 481 |
<keyword attribute="Special Variable" context="#stay" String="specialvars" additionalDeliminator="."/> |
| 482 |
<WordDetect attribute="Self Variable" context="#stay" String="self" additionalDeliminator="." /> |
| 483 |
<keyword attribute="Control" context="StartControl" beginRegion="chunk" String="startcontrol" /> |
| 484 |
<keyword attribute="Control" context="#stay" String="control" /> |
| 485 |
|
| 486 |
<DetectChar attribute="Symbols" context="#stay" beginRegion="table" char="{" /> |
| 487 |
<DetectChar attribute="Symbols" context="#stay" endRegion="table" char="}" /> |
| 488 |
|
| 489 |
<RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z_][a-zA-Z0-9_]*(?=\s*([({'"]|\[\[|\[=))" /> |
| 490 |
<RegExpr attribute="Constant" context="#stay" String="[A-Z_][A-Z0-9_]*\b" /> |
| 491 |
<DetectIdentifier attribute="Variable" context="#stay" /> |
| 492 |
|
| 493 |
<RegExpr attribute="Numbers" context="NumberSuffix" String="(?:0[xX](?:\.&HEX;+|&HEX;+\.?&HEX;*)(?:[pP][-+]?\d*)?|(?:\.\d+|\d+\.?\d*)(?:[eE][-+]?\d*)?)"/> |
| 494 |
|
| 495 |
<Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> |
| 496 |
<Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> |
| 497 |
<Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> |
| 498 |
<Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> |
| 499 |
<Detect2Chars attribute="Error" context="#stay" char="." char1="="/> |
| 500 |
<AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> |
| 501 |
</context> |
| 502 |
|
| 503 |
<context name="ShebangLine" attribute="Comment" lineEndContext="#pop" /> |
| 504 |
|
| 505 |
<context name="MatchComment" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 506 |
<IncludeRules context="##DoxygenLua" /> |
| 507 |
<RegExpr attribute="Comment" context="#pop!BlockComment" String="--\[(=*)\[" beginRegion="BlockComment" /> |
| 508 |
<Detect2Chars attribute="Comment" context="#pop!Comment" char="-" char1="-" /> |
| 509 |
</context> |
| 510 |
|
| 511 |
<context name="BlockComment" attribute="Comment" lineEndContext="#stay" dynamic="true"> |
| 512 |
<IncludeRules context="Comment" /> |
| 513 |
<StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BlockComment" /> |
| 514 |
</context> |
| 515 |
|
| 516 |
<context name="Comment" attribute="Comment" lineEndContext="#pop"> |
| 517 |
<DetectSpaces /> |
| 518 |
<IncludeRules context="##Comments" /> |
| 519 |
<DetectIdentifier /> |
| 520 |
</context> |
| 521 |
|
| 522 |
<context name="StartControl" attribute="Normal Text" lineEndContext="#stay"> |
| 523 |
<keyword attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elsecontrol" /> |
| 524 |
<keyword attribute="Control" context="#pop" endRegion="chunk" String="endcontrol" /> |
| 525 |
<IncludeRules context="Normal" /> |
| 526 |
</context> |
| 527 |
|
| 528 |
<context name="NumberSuffix" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 529 |
<!-- some syntax like a=32print(a) are valid, but ugly --> |
| 530 |
<DetectIdentifier attribute="Error" context="#pop" /> |
| 531 |
</context> |
| 532 |
|
| 533 |
<context name="Local" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 534 |
<DetectSpaces /> |
| 535 |
<WordDetect attribute="Keyword" context="#pop!Function" beginRegion="chunk" String="function" /> |
| 536 |
<Detect2Chars attribute="Comment" context="MatchComment" char="-" char1="-" lookAhead="true"/> |
| 537 |
<RegExpr attribute="Constant" context="LocalVariable" String="\b[A-Z_][A-Z0-9_]*\b" /> |
| 538 |
<DetectIdentifier attribute="Variable" context="LocalVariable" /> |
| 539 |
</context> |
| 540 |
|
| 541 |
<context name="LocalVariable" attribute="Normal Text" lineEndContext="#pop#pop" fallthroughContext="#pop#pop"> |
| 542 |
<DetectSpaces /> |
| 543 |
<Detect2Chars attribute="Comment" context="MatchComment" char="-" char1="-" lookAhead="true"/> |
| 544 |
<DetectChar attribute="Symbols" context="#pop" char="," /> |
| 545 |
<DetectChar attribute="Attribute" context="Attribute" char="<" lookAhead="true" /> |
| 546 |
</context> |
| 547 |
|
| 548 |
<context name="Attribute" attribute="Attribute" lineEndContext="#pop"> |
| 549 |
<RegExpr attribute="Attribute" context="#pop" String="<\s*(?:close|const)\s*>" /> |
| 550 |
<RegExpr attribute="Error" context="#pop" String="<\s*\w*\s*>?" /> |
| 551 |
</context> |
| 552 |
|
| 553 |
<context name="Function" attribute="Normal Text" lineEndContext="#stay"> |
| 554 |
<WordDetect attribute="Keyword" context="#pop" endRegion="chunk" String="end" /> |
| 555 |
<IncludeRules context="Normal" /> |
| 556 |
</context> |
| 557 |
|
| 558 |
<context name="String_single" attribute="Strings" lineEndContext="Error"> |
| 559 |
<DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> |
| 560 |
<DetectChar attribute="Strings" context="#pop" char="'"/> |
| 561 |
</context> |
| 562 |
|
| 563 |
<context name="String_double" attribute="Strings" lineEndContext="Error"> |
| 564 |
<DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> |
| 565 |
<DetectChar attribute="Strings" context="#pop" char="""/> |
| 566 |
</context> |
| 567 |
|
| 568 |
<context name="Special_char" attribute="Error" lineEndContext="#pop"> |
| 569 |
<LineContinue attribute="Special Char" context="#pop" /> |
| 570 |
<Detect2Chars attribute="Special Char" context="Special_char_\z" char="\" char1="z" lookAhead="true"/> |
| 571 |
<RegExpr attribute="Special Char" context="#pop" String="\\(?:[abfnrtv'"\\\[\]]|x&HEX;&HEX;|\d{1,3}|u\{&HEX;{1,6}\})"/> |
| 572 |
<DetectChar attribute="Error" context="#pop" char="\"/> |
| 573 |
</context> |
| 574 |
|
| 575 |
<context name="Special_char_\z" attribute="Special Char" lineEndContext="#stay"> |
| 576 |
<LineContinue attribute="Special Char" context="#pop#pop" char="z"/> |
| 577 |
<DetectChar attribute="Special Char" context="#pop#pop" char="z"/> |
| 578 |
</context> |
| 579 |
|
| 580 |
<context name="String_block" attribute="RawStrings" lineEndContext="#stay" dynamic="true"> |
| 581 |
<StringDetect attribute="RawStrings" context="#pop" String="]%1]" dynamic="true" /> |
| 582 |
</context> |
| 583 |
|
| 584 |
<context name="Error" attribute="Error" lineEndContext="#stay"> |
| 585 |
</context> |
| 586 |
</contexts> |
| 587 |
|
| 588 |
<itemDatas> |
| 589 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 590 |
<itemData name="Metamethod" defStyleNum="dsBuiltIn" spellChecking="false"/> |
| 591 |
<itemData name="BFunc" defStyleNum="dsFunction" spellChecking="false"/> |
| 592 |
<itemData name="BVar" defStyleNum="dsVariable" spellChecking="false"/> |
| 593 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 594 |
<itemData name="Constant" defStyleNum="dsConstant" spellChecking="false"/> |
| 595 |
<itemData name="Control" defStyleNum="dsControlFlow" spellChecking="false"/> |
| 596 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 597 |
<itemData name="Deprecated" defStyleNum="dsError" spellChecking="false"/> |
| 598 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> |
| 599 |
<itemData name="Special Variable" defStyleNum="dsKeyword" spellChecking="false"/> |
| 600 |
<itemData name="Numbers" defStyleNum="dsDecVal" spellChecking="false"/> |
| 601 |
<itemData name="Special Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 602 |
<itemData name="Strings" defStyleNum="dsString"/> |
| 603 |
<itemData name="RawStrings" defStyleNum="dsVerbatimString"/> |
| 604 |
<itemData name="Symbols" defStyleNum="dsOperator" spellChecking="false"/> |
| 605 |
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/> |
| 606 |
<itemData name="Self Variable" defStyleNum="dsVariable" spellChecking="false"/> |
| 607 |
<itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false"/> |
| 608 |
</itemDatas> |
| 609 |
</highlighting> |
| 610 |
<general> |
| 611 |
<comments> |
| 612 |
<comment name="singleLine" start="--" /> |
| 613 |
<comment name="multiLine" start="--[[" end="]]" region="BlockComment" /> |
| 614 |
</comments> |
| 615 |
<keywords casesensitive="1" weakDeliminator="." additionalDeliminator="'"#"/> |
| 616 |
</general> |
| 617 |
</language> |
| 618 |
<!-- kate: space-indent on; indent-width 2; replace-tabs on; --> |