Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/lua.xml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 6 | <!-- | |||
---|---|---|---|---|---|
43 | - based on Lua 5.0.2 syntax | 43 | - based on Lua 5.0.2 syntax | ||
44 | - strings "[[ ]]" and single quoted strings | 44 | - strings "[[ ]]" and single quoted strings | ||
45 | - block comments | 45 | - block comments | ||
46 | - 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 | ||
47 | - nil, false and true consided pseudo-variables (displayed as numbers) | 47 | - nil, false and true consided pseudo-variables (displayed as numbers) | ||
48 | - NOTE, FIXME, TODO alerts added on comments | 48 | - NOTE, FIXME, TODO alerts added on comments | ||
49 | - improved highlighting | 49 | - improved highlighting | ||
50 | --> | 50 | --> | ||
51 | <language name="Lua" version="6" indenter="lua" kateversion="5.0" section="Scripts" extensions="*.lua" mimetype="text/x-lua"> | 51 | <language name="Lua" version="7" indenter="lua" kateversion="5.0" section="Scripts" extensions="*.lua" mimetype="text/x-lua"> | ||
52 | <highlighting> | 52 | <highlighting> | ||
53 | <list name="keywords"> | 53 | <list name="keywords"> | ||
54 | <item>and</item> | 54 | <item>and</item> | ||
55 | <item>function</item> | 55 | <item>function</item> | ||
56 | <item>in</item> | 56 | <item>in</item> | ||
57 | <item>local</item> | 57 | <item>local</item> | ||
58 | <item>not</item> | 58 | <item>not</item> | ||
59 | <item>or</item> | 59 | <item>or</item> | ||
Show All 14 Lines | 66 | <list name="control"> | |||
74 | <item>if</item> | 74 | <item>if</item> | ||
75 | <item>repeat</item> | 75 | <item>repeat</item> | ||
76 | <item>return</item> | 76 | <item>return</item> | ||
77 | <item>then</item> | 77 | <item>then</item> | ||
78 | <item>until</item> | 78 | <item>until</item> | ||
79 | <item>while</item> | 79 | <item>while</item> | ||
80 | </list> | 80 | </list> | ||
81 | 81 | | |||
82 | <list name="startcontrol"> | ||||
83 | <item>do</item> | ||||
84 | <item>if</item> | ||||
85 | <item>repeat</item> | ||||
86 | </list> | ||||
87 | | ||||
88 | <list name="elsecontrol"> | ||||
89 | <item>else</item> | ||||
90 | <item>elseif</item> | ||||
91 | </list> | ||||
92 | | ||||
93 | <list name="endcontrol"> | ||||
94 | <item>end</item> | ||||
95 | <item>until</item> | ||||
96 | </list> | ||||
97 | | ||||
82 | <list name="basevar"> | 98 | <list name="basevar"> | ||
83 | <item>_PROMPT</item> | 99 | <item>_PROMPT</item> | ||
84 | <item>_PROMPT2</item> | 100 | <item>_PROMPT2</item> | ||
85 | <item>LUA_PATH</item> | 101 | <item>LUA_PATH</item> | ||
86 | <item>LUA_CPATH</item> | 102 | <item>LUA_CPATH</item> | ||
87 | <item>LUA_INIT</item> | 103 | <item>LUA_INIT</item> | ||
88 | <item>_ENV</item> | 104 | <item>_ENV</item> | ||
89 | <item>_VERSION</item> | 105 | <item>_VERSION</item> | ||
▲ Show 20 Lines • Show All 367 Lines • ▼ Show 20 Line(s) | 467 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | |||
457 | <DetectChar attribute="Strings" context="String_single" char="'"/> | 473 | <DetectChar attribute="Strings" context="String_single" char="'"/> | ||
458 | <DetectChar attribute="Strings" context="String_double" char="""/> | 474 | <DetectChar attribute="Strings" context="String_double" char="""/> | ||
459 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | 475 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | ||
460 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | 476 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | ||
461 | <keyword attribute="BVar" context="#stay" String="basevar"/> | 477 | <keyword attribute="BVar" context="#stay" String="basevar"/> | ||
462 | 478 | | |||
463 | <WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> | 479 | <WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> | ||
464 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | 480 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | ||
465 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="else" /> | 481 | <keyword attribute="Control" context="StartControl" beginRegion="chunk" String="startcontrol" /> | ||
466 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elseif" /> | | |||
467 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="do" /> | | |||
468 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="if" /> | | |||
469 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" String="end" /> | | |||
470 | <keyword attribute="Control" context="#stay" String="control" /> | 482 | <keyword attribute="Control" context="#stay" String="control" /> | ||
471 | 483 | | |||
472 | <DetectChar attribute="Symbols" context="#stay" beginRegion="table" char="{" /> | 484 | <DetectChar attribute="Symbols" context="#stay" beginRegion="table" char="{" /> | ||
473 | <DetectChar attribute="Symbols" context="#stay" endRegion="table" char="}" /> | 485 | <DetectChar attribute="Symbols" context="#stay" endRegion="table" char="}" /> | ||
474 | 486 | | |||
475 | <RegExpr attribute="Numbers" context="#stay" String="(?:0[xX](?:\.&HEX;+|&HEX;+\.?&HEX;*)(?:[pP][-+]?\d*)?|(?:\.\d+|\d+\.?\d*)(?:[eE][-+]?\d*)?)"/> | 487 | <RegExpr attribute="Numbers" context="#stay" String="(?:0[xX](?:\.&HEX;+|&HEX;+\.?&HEX;*)(?:[pP][-+]?\d*)?|(?:\.\d+|\d+\.?\d*)(?:[eE][-+]?\d*)?)"/> | ||
476 | 488 | | |||
477 | <RegExpr attribute="Normal Text" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*(?=\s*([({'"]|\[\[|\[=))" /> | 489 | <RegExpr attribute="Normal Text" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*(?=\s*([({'"]|\[\[|\[=))" /> | ||
478 | <RegExpr attribute="Constant" context="#stay" String="\b[A-Z_][A-Z0-9_]*\b" /> | 490 | <RegExpr attribute="Constant" context="#stay" String="\b[A-Z_][A-Z0-9_]*\b" /> | ||
479 | <RegExpr attribute="Variable" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*\b" /> | 491 | <RegExpr attribute="Variable" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*\b" /> | ||
480 | 492 | | |||
481 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | 493 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | ||
482 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | 494 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | ||
483 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | 495 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | ||
484 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | 496 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | ||
485 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | 497 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | ||
486 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | 498 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | ||
487 | </context> | 499 | </context> | ||
488 | 500 | | |||
501 | <context name="StartControl" attribute="Normal Text" lineEndContext="#stay"> | ||||
502 | <keyword attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elsecontrol" /> | ||||
503 | <keyword attribute="Control" context="#pop" endRegion="chunk" String="endcontrol" /> | ||||
504 | <IncludeRules context="Normal" /> | ||||
505 | </context> | ||||
506 | | ||||
489 | <context name="Function" attribute="Normal Text" lineEndContext="#stay"> | 507 | <context name="Function" attribute="Normal Text" lineEndContext="#stay"> | ||
490 | <WordDetect attribute="Keyword" context="#pop" endRegion="chunk" String="end" /> | 508 | <WordDetect attribute="Keyword" context="#pop" endRegion="chunk" String="end" /> | ||
491 | <IncludeRules context="Normal" /> | 509 | <IncludeRules context="Normal" /> | ||
492 | </context> | 510 | </context> | ||
493 | 511 | | |||
494 | <context name="String_single" attribute="Strings" lineEndContext="Error"> | 512 | <context name="String_single" attribute="Strings" lineEndContext="Error"> | ||
495 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | 513 | <DetectChar attribute="Strings" context="Special_char" char="\" lookAhead="true"/> | ||
496 | <DetectChar attribute="Strings" context="#pop" char="'"/> | 514 | <DetectChar attribute="Strings" context="#pop" char="'"/> | ||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |