mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
parser PR: https://github.com/madskjeldgaard/tree-sitter-supercollider/pull/67 removed nodes: control_structure, if, while, for, forby, method_call, method_name, instance_variable_setter_call, argument_calls added nodes: class_def_body, !==, === modified nodes: function_call now has fields receiver, name and arguments chained method calls now appear as nested function_calls (where receiver is another function_call)
140 lines
1.8 KiB
Scheme
140 lines
1.8 KiB
Scheme
; highlights.scm
|
|
; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md
|
|
; Comments
|
|
(line_comment) @comment @spell
|
|
|
|
(block_comment) @comment @spell
|
|
|
|
; Argument definition
|
|
(argument
|
|
name: (identifier) @variable.parameter)
|
|
|
|
"..." @variable.parameter ; variable argument
|
|
|
|
; For function calls
|
|
(named_argument
|
|
name: (identifier) @variable.parameter)
|
|
|
|
; Variables
|
|
(local_var
|
|
name: (identifier) @variable)
|
|
|
|
(environment_var
|
|
name: (identifier) @variable.builtin)
|
|
|
|
(builtin_var) @constant.builtin
|
|
|
|
; Functions
|
|
(function_definition
|
|
name: (variable) @function)
|
|
|
|
; Methods
|
|
(function_call
|
|
name: (_) @function.method.call)
|
|
|
|
; Collections
|
|
(associative_item
|
|
(identifier) @property)
|
|
|
|
; Classes
|
|
(class) @type
|
|
|
|
(parent_class) @type
|
|
|
|
(instance_method_name) @function.method
|
|
|
|
(class_method_name) @function.method
|
|
|
|
; Literals
|
|
(bool) @boolean
|
|
|
|
(number) @number
|
|
|
|
(float) @number.float
|
|
|
|
(string) @string
|
|
|
|
(escape_sequence) @string.escape
|
|
|
|
(symbol) @string.special.symbol
|
|
|
|
; Conditionals
|
|
[
|
|
"?"
|
|
"!?"
|
|
"??"
|
|
] @keyword.conditional
|
|
|
|
((function_call
|
|
name: (_) @keyword.conditional)
|
|
(#any-of? @keyword.conditional "if" "while" "case" "switch" "try" "protect"))
|
|
|
|
((function_call
|
|
name: (_) @keyword.repeat)
|
|
(#any-of? @keyword.repeat "for" "forBy"))
|
|
|
|
; Duplication operator
|
|
"!" @keyword.repeat
|
|
|
|
; Operators
|
|
[
|
|
"&&"
|
|
"||"
|
|
"&"
|
|
"|"
|
|
"^"
|
|
"=="
|
|
"!="
|
|
"==="
|
|
"!=="
|
|
"<"
|
|
"<="
|
|
">"
|
|
">="
|
|
"<<"
|
|
">>"
|
|
"+"
|
|
"-"
|
|
"*"
|
|
"/"
|
|
"%"
|
|
"="
|
|
"@"
|
|
"|@|"
|
|
"@@"
|
|
"@|@"
|
|
"++"
|
|
"+/+"
|
|
".."
|
|
] @operator
|
|
|
|
; Keywords
|
|
[
|
|
"arg"
|
|
"classvar"
|
|
"const"
|
|
"var"
|
|
] @keyword
|
|
|
|
((local_var
|
|
name: (identifier) @variable.builtin)
|
|
(#any-of? @variable.builtin "this" "super"))
|
|
|
|
; Brackets
|
|
[
|
|
"("
|
|
")"
|
|
"["
|
|
"]"
|
|
"{"
|
|
"}"
|
|
"|"
|
|
] @punctuation.bracket
|
|
|
|
; Delimiters
|
|
[
|
|
";"
|
|
"."
|
|
","
|
|
":"
|
|
] @punctuation.delimiter
|