2020-04-20 16:18:02 +02:00
|
|
|
;;; Highlighting for lua
|
|
|
|
|
|
|
|
|
|
;;; Builtins
|
|
|
|
|
;; Keywords
|
2020-07-05 19:58:47 +02:00
|
|
|
(
|
2020-07-16 09:30:15 +02:00
|
|
|
"if" @conditional
|
|
|
|
|
"end" @conditional
|
|
|
|
|
)
|
|
|
|
|
[
|
2020-07-05 19:58:47 +02:00
|
|
|
"else"
|
|
|
|
|
"elseif"
|
2020-07-16 09:30:15 +02:00
|
|
|
"then"
|
|
|
|
|
] @conditional
|
2020-06-30 08:59:34 +02:00
|
|
|
|
|
|
|
|
|
2020-07-05 19:58:47 +02:00
|
|
|
(
|
|
|
|
|
[
|
|
|
|
|
"do"
|
|
|
|
|
"while"
|
|
|
|
|
"repeat"
|
|
|
|
|
"for"
|
|
|
|
|
] @repeat
|
|
|
|
|
|
|
|
|
|
"end" @repeat
|
|
|
|
|
)
|
2020-06-30 08:59:34 +02:00
|
|
|
|
|
|
|
|
[
|
2020-08-03 21:40:23 -05:00
|
|
|
"in"
|
|
|
|
|
"local"
|
|
|
|
|
"return"
|
|
|
|
|
(break_statement)
|
|
|
|
|
"goto"
|
2020-06-30 08:59:34 +02:00
|
|
|
] @keyword
|
2020-04-20 16:18:02 +02:00
|
|
|
|
|
|
|
|
;; Operators
|
2020-06-30 08:59:34 +02:00
|
|
|
[
|
2020-08-11 10:04:34 +02:00
|
|
|
"="
|
2020-06-30 08:59:34 +02:00
|
|
|
"~="
|
|
|
|
|
"=="
|
|
|
|
|
"<="
|
|
|
|
|
">="
|
|
|
|
|
"not"
|
|
|
|
|
"and"
|
|
|
|
|
"or"
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
"+"
|
|
|
|
|
"-"
|
|
|
|
|
"%"
|
|
|
|
|
"/"
|
|
|
|
|
"//"
|
|
|
|
|
"*"
|
|
|
|
|
"^"
|
|
|
|
|
"&"
|
|
|
|
|
"~"
|
|
|
|
|
"|"
|
|
|
|
|
">>"
|
|
|
|
|
"<<"
|
|
|
|
|
".."
|
|
|
|
|
"#"
|
|
|
|
|
] @operator
|
|
|
|
|
|
2020-08-11 10:04:34 +02:00
|
|
|
;; Punctuation
|
|
|
|
|
[ "," "." ] @punctuation.delimiter
|
|
|
|
|
|
2020-07-27 20:00:18 -05:00
|
|
|
;; Brackets
|
|
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
] @punctuation.bracket
|
2020-04-20 16:18:02 +02:00
|
|
|
|
|
|
|
|
;; Constants
|
2020-06-30 08:59:34 +02:00
|
|
|
[
|
|
|
|
|
(false)
|
|
|
|
|
(true)
|
|
|
|
|
] @boolean
|
2020-05-07 09:23:33 +02:00
|
|
|
(nil) @constant.builtin
|
2020-04-20 19:13:24 +02:00
|
|
|
(spread) @constant ;; "..."
|
2020-04-20 16:18:02 +02:00
|
|
|
|
2020-08-03 21:40:23 -05:00
|
|
|
;; Functions
|
|
|
|
|
("function" @keyword.function
|
|
|
|
|
[(function_name) (identifier)] @function
|
|
|
|
|
"end" @keyword.function)
|
2020-06-30 08:59:34 +02:00
|
|
|
|
2020-08-03 21:40:23 -05:00
|
|
|
;; Nodes
|
2020-06-30 08:59:34 +02:00
|
|
|
(table ["{" "}"] @constructor)
|
2020-04-20 16:18:02 +02:00
|
|
|
(comment) @comment
|
|
|
|
|
(string) @string
|
2020-04-20 19:13:24 +02:00
|
|
|
(number) @number
|
|
|
|
|
(label_statement) @label
|
2020-04-20 16:18:02 +02:00
|
|
|
|
|
|
|
|
;; Error
|
2020-08-03 19:43:17 -05:00
|
|
|
(ERROR) @error
|