Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/lua.xml
Show All 29 Lines | 6 | <!-- | |||
---|---|---|---|---|---|
30 | - highlight the Kepler function (cgilua, luasql, lfs, luazip) | 30 | - highlight the Kepler function (cgilua, luasql, lfs, luazip) | ||
31 | - true, false and nil are highlighted in black | 31 | - true, false and nil are highlighted in black | ||
32 | - table.foreach and foreachi are marked as alerts | 32 | - table.foreach and foreachi are marked as alerts | ||
33 | 33 | | |||
34 | [ Version 1.01 (2007-01-01) by Bruno Massa ] | 34 | [ Version 1.01 (2007-01-01) by Bruno Massa ] | ||
35 | 35 | | |||
36 | - highlighting similar to PHP | 36 | - highlighting similar to PHP | ||
37 | - error detection on one-line strings and common mistakes from other languages like using "!=" "++" | 37 | - error detection on one-line strings and common mistakes from other languages like using "!=" "++" | ||
38 | - uppercase-only variables are highlighted as constants | 38 | - uppercase-only variables are highlighted as constants | ||
39 | - { } now is collapsable | 39 | - { } now is collapsable | ||
40 | 40 | | |||
41 | [ Version 1.00 (2006-12-05) by Bruno Massa ] | 41 | [ Version 1.00 (2006-12-05) by Bruno Massa ] | ||
42 | 42 | | |||
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> | ||
60 | <!-- pseudo-variables --> | 60 | <!-- pseudo-variables --> | ||
61 | <item>nil</item> | 61 | <item>nil</item> | ||
62 | <item>false</item> | 62 | <item>false</item> | ||
63 | <item>true</item> | 63 | <item>true</item> | ||
64 | </list> | 64 | </list> | ||
65 | 65 | | |||
66 | <list name="control"> | 66 | <list name="control"> | ||
67 | <item>break</item> | ||||
68 | <item>do</item> | ||||
69 | <item>else</item> | ||||
70 | <item>elseif</item> | ||||
71 | <item>end</item> | ||||
72 | <item>for</item> | ||||
73 | <item>goto</item> | ||||
74 | <item>if</item> | ||||
75 | <item>repeat</item> | ||||
76 | <item>return</item> | ||||
77 | <item>then</item> | ||||
78 | <item>until</item> | ||||
79 | <item>while</item> | ||||
80 | </list> | ||||
81 | | ||||
82 | <list name="startcontrol"> | ||||
67 | <item>break</item> | 83 | <item>do</item> | ||
68 | <item>do</item> | 84 | <item>if</item> | ||
69 | <item>else</item> | 85 | <item>repeat</item> | ||
70 | <item>elseif</item> | 86 | </list> | ||
71 | <item>end</item> | 87 | | ||
72 | <item>for</item> | 88 | <list name="elsecontrol"> | ||
73 | <item>goto</item> | 89 | <item>else</item> | ||
74 | <item>if</item> | 90 | <item>elseif</item> | ||
75 | <item>repeat</item> | 91 | </list> | ||
76 | <item>return</item> | 92 | | ||
77 | <item>then</item> | 93 | <list name="endcontrol"> | ||
78 | <item>until</item> | 94 | <item>end</item> | ||
79 | <item>while</item> | 95 | <item>until</item> | ||
80 | </list> | 96 | </list> | ||
81 | 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> | ||
▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Line(s) | 401 | <list name="metamethod"> | |||
415 | <!-- Weak table --> | 431 | <!-- Weak table --> | ||
416 | <item>__mode</item> | 432 | <item>__mode</item> | ||
417 | </list> | 433 | </list> | ||
418 | 434 | | |||
419 | <list name="deprecated"> | 435 | <list name="deprecated"> | ||
420 | <item>_ALERT</item> | 436 | <item>_ALERT</item> | ||
421 | <item>_ERRORMESSAGE</item> | 437 | <item>_ERRORMESSAGE</item> | ||
422 | <item>_LOADED</item> | 438 | <item>_LOADED</item> | ||
423 | <item>__ipairs</item> | 439 | <item>__ipairs</item> | ||
424 | <item>foreach</item> | | |||
425 | <item>foreachi</item> | | |||
426 | <item>loadstring</item> | | |||
427 | <item>math.atan2</item> | | |||
428 | <item>math.cosh</item> | 440 | <item>foreach</item> | ||
429 | <item>math.frexp</item> | 441 | <item>foreachi</item> | ||
430 | <item>math.ldexp</item> | 442 | <item>loadstring</item> | ||
431 | <item>math.log10</item> | 443 | <item>math.atan2</item> | ||
432 | <item>math.mod</item> | 444 | <item>math.cosh</item> | ||
433 | <item>math.pow</item> | 445 | <item>math.frexp</item> | ||
434 | <item>math.sinh</item> | 446 | <item>math.ldexp</item> | ||
435 | <item>math.tanh</item> | 447 | <item>math.log10</item> | ||
436 | <item>string.gfind</item> | 448 | <item>math.mod</item> | ||
437 | <item>table.foreach</item> | 449 | <item>math.pow</item> | ||
438 | <item>table.foreachi</item> | 450 | <item>math.sinh</item> | ||
439 | <item>table.getn</item> | 451 | <item>math.tanh</item> | ||
440 | <item>table.setn</item> | 452 | <item>string.gfind</item> | ||
441 | </list> | 453 | <item>table.foreach</item> | ||
454 | <item>table.foreachi</item> | ||||
455 | <item>table.getn</item> | ||||
456 | <item>table.setn</item> | ||||
457 | </list> | ||||
458 | | ||||
459 | <contexts> | ||||
442 | 460 | <context name="Shebang" attribute="Comment" lineEndContext="Normal" lineEmptyContext="Normal" fallthrough="true" fallthroughContext="Normal"> | |||
443 | <contexts> | 461 | <Detect2Chars attribute="Comment" context="Comment" char="#" char1="!" column="0"/> | ||
444 | <context name="Shebang" attribute="Comment" lineEndContext="Normal" lineEmptyContext="Normal" fallthrough="true" fallthroughContext="Normal"> | 462 | </context> | ||
445 | <Detect2Chars attribute="Comment" context="Comment" char="#" char1="!" column="0"/> | 463 | | ||
446 | </context> | 464 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | ||
447 | 465 | </context> | |||
448 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | 466 | | ||
449 | </context> | 467 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | ||
450 | 468 | <DetectSpaces /> | |||
451 | <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> | 469 | <keyword attribute="Deprecated" context="#stay" String="deprecated" /> | ||
452 | <DetectSpaces /> | 470 | <IncludeRules context="##DoxygenLua" /> | ||
453 | <keyword attribute="Deprecated" context="#stay" String="deprecated" /> | 471 | | ||
454 | <IncludeRules context="##DoxygenLua" /> | 472 | <RegExpr attribute="RawStrings" context="String_block" String="\[(=*)\[" dynamic="true" /> | ||
455 | 473 | <DetectChar attribute="Strings" context="String_single" char="'"/> | |||
456 | <RegExpr attribute="RawStrings" context="String_block" String="\[(=*)\[" dynamic="true" /> | 474 | <DetectChar attribute="Strings" context="String_double" char="""/> | ||
457 | <DetectChar attribute="Strings" context="String_single" char="'"/> | 475 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | ||
458 | <DetectChar attribute="Strings" context="String_double" char="""/> | 476 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | ||
459 | <keyword attribute="BFunc" context="#stay" String="basefunc"/> | 477 | <keyword attribute="BVar" context="#stay" String="basevar"/> | ||
460 | <keyword attribute="Metamethod" context="#stay" String="metamethod"/> | 478 | | ||
461 | <keyword attribute="BVar" context="#stay" String="basevar"/> | 479 | <WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> | ||
462 | 480 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | |||
463 | <WordDetect attribute="Keyword" context="Function" beginRegion="chunk" String="function" /> | 481 | <keyword attribute="Control" context="StartControl" beginRegion="chunk" String="startcontrol" /> | ||
464 | <keyword attribute="Keyword" context="#stay" String="keywords" /> | 482 | <keyword attribute="Control" context="#stay" String="control" /> | ||
465 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="else" /> | 483 | | ||
466 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elseif" /> | 484 | <DetectChar attribute="Symbols" context="#stay" beginRegion="table" char="{" /> | ||
467 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="do" /> | 485 | <DetectChar attribute="Symbols" context="#stay" endRegion="table" char="}" /> | ||
468 | <WordDetect attribute="Control" context="#stay" beginRegion="chunk" String="if" /> | 486 | | ||
469 | <WordDetect attribute="Control" context="#stay" endRegion="chunk" String="end" /> | 487 | <RegExpr attribute="Numbers" context="#stay" String="(?:0[xX](?:\.&HEX;+|&HEX;+\.?&HEX;*)(?:[pP][-+]?\d*)?|(?:\.\d+|\d+\.?\d*)(?:[eE][-+]?\d*)?)"/> | ||
470 | <keyword attribute="Control" context="#stay" String="control" /> | 488 | | ||
471 | 489 | <RegExpr attribute="Normal Text" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*(?=\s*([({'"]|\[\[|\[=))" /> | |||
472 | <DetectChar attribute="Symbols" context="#stay" beginRegion="table" char="{" /> | 490 | <RegExpr attribute="Constant" context="#stay" String="\b[A-Z_][A-Z0-9_]*\b" /> | ||
473 | <DetectChar attribute="Symbols" context="#stay" endRegion="table" char="}" /> | 491 | <RegExpr attribute="Variable" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*\b" /> | ||
474 | 492 | | |||
475 | <RegExpr attribute="Numbers" context="#stay" String="(?:0[xX](?:\.&HEX;+|&HEX;+\.?&HEX;*)(?:[pP][-+]?\d*)?|(?:\.\d+|\d+\.?\d*)(?:[eE][-+]?\d*)?)"/> | 493 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | ||
476 | 494 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | |||
477 | <RegExpr attribute="Normal Text" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*(?=\s*([({'"]|\[\[|\[=))" /> | 495 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | ||
478 | <RegExpr attribute="Constant" context="#stay" String="\b[A-Z_][A-Z0-9_]*\b" /> | 496 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | ||
479 | <RegExpr attribute="Variable" context="#stay" String="\b[a-zA-Z_][a-zA-Z0-9_]*\b" /> | 497 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | ||
480 | 498 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | |||
481 | <Detect2Chars attribute="Error" context="#stay" char="!" char1="="/> | 499 | </context> | ||
482 | <Detect2Chars attribute="Error" context="#stay" char="-" char1="="/> | 500 | | ||
483 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="="/> | 501 | <context name="StartControl" attribute="Normal Text" lineEndContext="#stay"> | ||
484 | <Detect2Chars attribute="Error" context="#stay" char="+" char1="+"/> | 502 | <keyword attribute="Control" context="#stay" endRegion="chunk" beginRegion="chunk" String="elsecontrol" /> | ||
485 | <Detect2Chars attribute="Error" context="#stay" char="." char1="="/> | 503 | <keyword attribute="Control" context="#pop" endRegion="chunk" String="endcontrol" /> | ||
486 | <AnyChar attribute="Symbols" context="#stay" String=":[]().,=~+-*/%&|^><#;" /> | 504 | <IncludeRules context="Normal" /> | ||
487 | </context> | 505 | </context> | ||
488 | 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"> | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |