mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
highlights(lua): update query to new syntax
This commit is contained in:
parent
255d1756b0
commit
bae85e6bcc
1 changed files with 55 additions and 42 deletions
|
|
@ -2,57 +2,70 @@
|
||||||
|
|
||||||
;;; Builtins
|
;;; Builtins
|
||||||
;; Keywords
|
;; Keywords
|
||||||
"local" @keyword
|
|
||||||
"if" @conditional
|
[
|
||||||
"then" @conditional
|
"if"
|
||||||
"else" @conditional
|
"then"
|
||||||
"elseif" @conditional
|
"else"
|
||||||
"end" @keyword
|
"elseif"
|
||||||
"return" @keyword
|
] @conditional
|
||||||
"do" @repeat
|
|
||||||
"while" @repeat
|
[
|
||||||
"repeat" @repeat
|
"do"
|
||||||
"for" @repeat
|
"while"
|
||||||
(break_statement) @keyword
|
"repeat"
|
||||||
"goto" @keyword
|
"for"
|
||||||
|
"in"
|
||||||
|
] @repeat
|
||||||
|
|
||||||
|
[
|
||||||
|
"local"
|
||||||
|
"end"
|
||||||
|
"return"
|
||||||
|
(break_statement)
|
||||||
|
"goto"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
;; Operators
|
;; Operators
|
||||||
"~=" @operator
|
[
|
||||||
"==" @operator
|
"~="
|
||||||
"<=" @operator
|
"=="
|
||||||
">=" @operator
|
"<="
|
||||||
"not" @operator
|
">="
|
||||||
"and" @operator
|
"not"
|
||||||
"or" @operator
|
"and"
|
||||||
"<" @operator
|
"or"
|
||||||
">" @operator
|
"<"
|
||||||
|
">"
|
||||||
|
"+"
|
||||||
|
"-"
|
||||||
|
"%"
|
||||||
|
"/"
|
||||||
|
"//"
|
||||||
|
"*"
|
||||||
|
"^"
|
||||||
|
"&"
|
||||||
|
"~"
|
||||||
|
"|"
|
||||||
|
">>"
|
||||||
|
"<<"
|
||||||
|
".."
|
||||||
|
"#"
|
||||||
|
] @operator
|
||||||
|
|
||||||
"+" @operator
|
|
||||||
"-" @operator
|
|
||||||
"%" @operator
|
|
||||||
"/" @operator
|
|
||||||
"//" @operator
|
|
||||||
"*" @operator
|
|
||||||
"^" @operator
|
|
||||||
"&" @operator
|
|
||||||
"~" @operator
|
|
||||||
"|" @operator
|
|
||||||
">>" @operator
|
|
||||||
"<<" @operator
|
|
||||||
".." @operator
|
|
||||||
"#" @operator
|
|
||||||
|
|
||||||
;; Constants
|
;; Constants
|
||||||
(false) @boolean
|
[
|
||||||
(true) @boolean
|
(false)
|
||||||
|
(true)
|
||||||
|
] @boolean
|
||||||
(nil) @constant.builtin
|
(nil) @constant.builtin
|
||||||
(spread) @constant ;; "..."
|
(spread) @constant ;; "..."
|
||||||
|
|
||||||
;; Nodes
|
;; Nodes
|
||||||
(function "function" @function "end" @function)
|
(_ "function" @function "end" @function) ;; Any node that has both funtion and end in it
|
||||||
(function_definition "function" @function "end" @function)
|
|
||||||
(local_function "function" @function "end" @function)
|
(table ["{" "}"] @constructor)
|
||||||
(table "{" @constructor "}" @constructor)
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(string) @string
|
(string) @string
|
||||||
(number) @number
|
(number) @number
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue