nvim-treesitter/queries/r/highlights.scm
2022-01-22 11:31:58 +01:00

121 lines
1.2 KiB
Scheme
Executable file

; highlights.scm
; Literals
(integer) @number
(float) @float
(complex) @number
(string) @string
(comment) @comment
(formal_parameters (identifier) @parameter)
(identifier) @variable
; Operators
[
"="
"<-"
"<<-"
"->"
] @operator
(unary operator: [
"-"
"+"
"!"
"~"
] @operator)
(binary operator: [
"-"
"+"
"*"
"/"
"^"
"<"
">"
"<="
">="
"=="
"!="
"||"
"|"
"&&"
"&"
":"
"~"
"|>"
] @operator)
(special) @operator
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(dollar "$" @operator)
(subset2
"[[" @punctuation.bracket
"]]" @punctuation.bracket)
[
"in"
(dots)
(break)
(next)
(inf)
] @keyword
[
(nan)
(na)
(null)
] @type.builtin
[
"if"
"else"
] @conditional
[
"while"
"repeat"
"for"
] @repeat
[
(true)
(false)
] @boolean
"function" @keyword.function
(call function: (identifier) @function)
(call arguments:
(arguments
name: (identifier) @parameter))
(lambda_function "\\" @operator)
(namespace_get function: (identifier) @method)
(namespace_get_internal function: (identifier) @method)
(namespace_get namespace: (identifier) @namespace
"::" @operator)
(namespace_get_internal namespace: (identifier) @namespace
":::" @operator)
; Error
(ERROR) @error