nvim-treesitter/queries/lua/highlights.scm

98 lines
890 B
Scheme
Raw Normal View History

2020-04-20 16:18:02 +02:00
;;; Highlighting for lua
;;; Builtins
;; Keywords
(
"if" @conditional
"end" @conditional
)
[
"else"
"elseif"
"then"
] @conditional
(
[
"do"
"while"
"repeat"
"for"
] @repeat
"end" @repeat
)
[
2020-08-03 21:40:23 -05:00
"in"
"local"
"return"
(break_statement)
"goto"
] @keyword
2020-04-20 16:18:02 +02:00
;; Operators
[
"="
"~="
"=="
"<="
">="
"not"
"and"
"or"
"<"
">"
"+"
"-"
"%"
"/"
"//"
"*"
"^"
"&"
"~"
"|"
">>"
"<<"
".."
"#"
] @operator
;; Punctuation
[ "," "." ] @punctuation.delimiter
;; Brackets
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
2020-04-20 16:18:02 +02:00
;; Constants
[
(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-08-03 21:40:23 -05:00
;; Nodes
(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