Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/lua.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd" | 2 | <!DOCTYPE language SYSTEM "language.dtd" | ||
3 | [ | 3 | [ | ||
4 | <!ENTITY HEX "[0-9A-Fa-f]"> | 4 | <!ENTITY HEX "[0-9A-Fa-f]"> | ||
5 | ]> | 5 | ]> | ||
6 | <!-- | 6 | <!-- | ||
7 | LUA (www.lua.org) syntax highlighting for Kate | 7 | LUA (www.lua.org) syntax highlighting for Kate | ||
8 | 8 | | |||
9 | CHANGES | 9 | CHANGES | ||
10 | 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 | | ||||
11 | [ Version 1.04 (2018-04-30) by Jonathan Poelen ] | 16 | [ Version 1.04 (2018-04-30) by Jonathan Poelen ] | ||
12 | 17 | | |||
13 | - based on Lua 5.3 | 18 | - based on Lua 5.3 | ||
14 | - some math.*, table.* and string.* are marked as deprecated | 19 | - some math.*, table.* and string.* are marked as deprecated | ||
15 | - fix special char, float format and ' collapsable | 20 | - fix special char, float format and ' collapsable | ||
16 | 21 | | |||
17 | [ Version 1.03 (2007-09-12) by Bruno Massa ] | 22 | [ Version 1.03 (2007-09-12) by Bruno Massa ] | ||
18 | 23 | | |||
Show All 19 Lines | |||||
38 | - based on Lua 5.0.2 syntax | 43 | - based on Lua 5.0.2 syntax | ||
39 | - strings "[[ ]]" and single quoted strings | 44 | - strings "[[ ]]" and single quoted strings | ||
40 | - block comments | 45 | - block comments | ||
41 | - function, if/elseif/else, do-end chunks, comment blocks, strings using [[ ]] collapsable | 46 | - function, if/elseif/else, do-end chunks, comment blocks, strings using [[ ]] collapsable | ||
42 | - nil, false and true consided pseudo-variables (displayed as numbers) | 47 | - nil, false and true consided pseudo-variables (displayed as numbers) | ||
43 | - NOTE, FIXME, TODO alerts added on comments | 48 | - NOTE, FIXME, TODO alerts added on comments | ||
44 | - improved highlighting | 49 | - improved highlighting | ||
45 | --> | 50 | --> | ||
46 | <language name="Lua" version="5" indenter="lua" kateversion="5.0" section="Scripts" extensions="*.lua" mimetype="text/x-lua"> | 51 | <language name="Lua" version="6" indenter="lua" kateversion="5.0" section="Scripts" extensions="*.lua" mimetype="text/x-lua"> | ||
47 | <highlighting> | 52 | <highlighting> | ||
48 | <list name="keywords"> | 53 | <list name="keywords"> | ||
49 | <item>and</item> | 54 | <item>and</item> | ||
50 | <item>function</item> | 55 | <item>function</item> | ||
51 | <item>in</item> | 56 | <item>in</item> | ||
52 | <item>local</item> | 57 | <item>local</item> | ||
53 | <item>not</item> | 58 | <item>not</item> | ||
54 | <item>or</item> | 59 | <item>or</item> | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 106 | <list name="basefunc"> | |||
116 | <item>rawget</item> | 121 | <item>rawget</item> | ||
117 | <item>rawlen</item> | 122 | <item>rawlen</item> | ||
118 | <item>rawset</item> | 123 | <item>rawset</item> | ||
119 | <item>select</item> | 124 | <item>select</item> | ||
120 | <item>setmetatable</item> | 125 | <item>setmetatable</item> | ||
121 | <item>tonumber</item> | 126 | <item>tonumber</item> | ||
122 | <item>tostring</item> | 127 | <item>tostring</item> | ||
123 | <item>type</item> | 128 | <item>type</item> | ||
129 | <item>warn</item> | ||||
124 | <item>xpcall</item> | 130 | <item>xpcall</item> | ||
125 | 131 | | |||
126 | <!-- Coroutine manipulation --> | 132 | <!-- Coroutine manipulation --> | ||
127 | <item>coroutine.create</item> | 133 | <item>coroutine.create</item> | ||
128 | <item>coroutine.isyieldable</item> | 134 | <item>coroutine.isyieldable</item> | ||
129 | <item>coroutine.resume</item> | 135 | <item>coroutine.resume</item> | ||
136 | <item>coroutine.kill</item> | ||||
130 | <item>coroutine.running</item> | 137 | <item>coroutine.running</item> | ||
131 | <item>coroutine.status</item> | 138 | <item>coroutine.status</item> | ||
132 | <item>coroutine.wrap</item> | 139 | <item>coroutine.wrap</item> | ||
133 | <item>coroutine.yield</item> | 140 | <item>coroutine.yield</item> | ||
134 | 141 | | |||
135 | <!-- Module --> | 142 | <!-- Module --> | ||
136 | <item>require</item> | 143 | <item>require</item> | ||
137 | <item>package.loadlib</item> | 144 | <item>package.loadlib</item> | ||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Line(s) | 451 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | |||
448 | 455 | | |||
449 | <RegExpr attribute="RawStrings" context="String_block" String="\[(=*)\[" dynamic="true" /> | 456 | <RegExpr attribute="RawStrings" context="String_block" String="\[(=*)\[" dynamic="true" /> | ||
450 | <DetectChar attribute="Strings" context="String_single" char="'"/> | 457 | <DetectChar attribute="Strings" context="String_single" char="'"/> | ||
451 | <DetectChar attribute="Strings" context="String_double" char="""/> | 458 | <DetectChar attribute="Strings" context="String_double" char="""/> | ||
452 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | 459 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | ||
453 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | 460 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | ||
454 | <keyword attribute="BVar" context="#stay" String="basevar"/> | 461 | <keyword attribute="BVar" context="#stay" String="basevar"/> | ||
455 | 462 | | |||
456 | <WordDetect attribute="Keyword" context="#stay" beginRegion="chunk" String="function" /> | 463 | <WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> | ||
457 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | 464 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | ||
458 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="else" /> | 465 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="else" /> | ||
459 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elseif" /> | 466 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elseif" /> | ||
460 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="do" /> | 467 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="do" /> | ||
461 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="if" /> | 468 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="if" /> | ||
462 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" String="end" /> | 469 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" String="end" /> | ||
463 | <keyword attribute="Control" context="#stay" String="control" /> | 470 | <keyword attribute="Control" context="#stay" String="control" /> | ||
464 | 471 | | |||
Show All 9 Lines | |||||
474 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | 481 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | ||
475 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | 482 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | ||
476 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | 483 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | ||
477 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | 484 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | ||
478 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | 485 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | ||
479 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | 486 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | ||
480 | </context> | 487 | </context> | ||
481 | 488 | | |||
489 | <context name="Function" attribute="Normal Text" lineEndContext="#stay"> | ||||
490 | <WordDetect attribute="Keyword" context="#pop" endRegion="chunk" String="end" /> | ||||
491 | <IncludeRules context="Normal" /> | ||||
492 | </context> | ||||
493 | | ||||
482 | <context name="String_single" attribute="Strings" lineEndContext="Error"> | 494 | <context name="String_single" attribute="Strings" lineEndContext="Error"> | ||
483 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | 495 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | ||
484 | <DetectChar attribute="Strings" context="#pop" char="'"/> | 496 | <DetectChar attribute="Strings" context="#pop" char="'"/> | ||
485 | </context> | 497 | </context> | ||
486 | 498 | | |||
487 | <context name="String_double" attribute="Strings" lineEndContext="Error"> | 499 | <context name="String_double" attribute="Strings" lineEndContext="Error"> | ||
488 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | 500 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | ||
489 | <DetectChar attribute="Strings" context="#pop" char="""/> | 501 | <DetectChar attribute="Strings" context="#pop" char="""/> | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
531 | <general> | 543 | <general> | ||
532 | <comments> | 544 | <comments> | ||
533 | <comment name="singleLine" start="--" /> | 545 | <comment name="singleLine" start="--" /> | ||
534 | <comment name="multiLine" start="--[[" end="]]" /> | 546 | <comment name="multiLine" start="--[[" end="]]" /> | ||
535 | </comments> | 547 | </comments> | ||
536 | <keywords casesensitive="1" weakDeliminator="." additionalDeliminator="'""/> | 548 | <keywords casesensitive="1" weakDeliminator="." additionalDeliminator="'""/> | ||
537 | </general> | 549 | </general> | ||
538 | </language> | 550 | </language> | ||
551 | <!-- kate: space-indent on; indent-width 2; replace-tabs on; --> |