2022-04-15 19:35:23 +04:00
|
|
|
; Identifier naming conventions
|
|
|
|
|
2023-03-05 22:41:18 +04:00
|
|
|
(
|
|
|
|
(identifier) @constant
|
|
|
|
(#match? @constant "^[A-Z][A-Z\\d_]+$"))
|
2022-04-15 19:35:23 +04:00
|
|
|
|
2022-09-10 17:47:08 +04:00
|
|
|
; class
|
|
|
|
(class_name_statement (name) @type)
|
|
|
|
(class_definition (name) @type)
|
|
|
|
|
|
|
|
|
2022-04-15 19:35:23 +04:00
|
|
|
; Function calls
|
|
|
|
|
|
|
|
(attribute_call (identifier) @function)
|
|
|
|
(base_call (identifier) @function)
|
|
|
|
(call (identifier) @function)
|
|
|
|
|
|
|
|
; Function definitions
|
|
|
|
|
|
|
|
(function_definition (name) @function)
|
|
|
|
(constructor_definition "_init" @function)
|
|
|
|
|
2023-03-05 22:41:18 +04:00
|
|
|
|
2022-04-15 19:35:23 +04:00
|
|
|
;; Literals
|
|
|
|
(comment) @comment
|
|
|
|
(string) @string
|
2023-03-05 22:41:18 +04:00
|
|
|
|
2022-04-15 19:35:23 +04:00
|
|
|
(type) @type
|
2023-03-05 22:41:18 +04:00
|
|
|
(expression_statement (array (identifier) @type))
|
|
|
|
(binary_operator (identifier) @type)
|
2022-04-15 19:35:23 +04:00
|
|
|
|
2023-03-05 22:41:18 +04:00
|
|
|
(variable_statement (identifier) @variable)
|
|
|
|
(get_node) @label
|
|
|
|
|
|
|
|
(const_statement (name) @constant)
|
|
|
|
(integer) @constant.numeric.integer
|
|
|
|
(float) @constant.numeric.float
|
|
|
|
(escape_sequence) @constant.character.escape
|
2022-04-15 19:35:23 +04:00
|
|
|
[
|
|
|
|
(true)
|
|
|
|
(false)
|
2023-03-05 22:41:18 +04:00
|
|
|
] @constant.builtin.boolean
|
|
|
|
(null) @constant.builtin
|
2022-04-15 19:35:23 +04:00
|
|
|
|
|
|
|
[
|
|
|
|
"+"
|
|
|
|
"-"
|
|
|
|
"*"
|
|
|
|
"/"
|
|
|
|
"%"
|
|
|
|
"=="
|
|
|
|
"!="
|
|
|
|
">"
|
|
|
|
"<"
|
|
|
|
">="
|
|
|
|
"<="
|
|
|
|
"="
|
|
|
|
"+="
|
|
|
|
"-="
|
|
|
|
"*="
|
|
|
|
"/="
|
|
|
|
"%="
|
|
|
|
"&"
|
|
|
|
"|"
|
|
|
|
"^"
|
|
|
|
"~"
|
|
|
|
"<<"
|
|
|
|
">>"
|
|
|
|
] @operator
|
|
|
|
|
2023-03-05 22:41:18 +04:00
|
|
|
(annotation (identifier) @keyword.storage.modifier)
|
|
|
|
|
2022-04-15 19:35:23 +04:00
|
|
|
[
|
|
|
|
"if"
|
|
|
|
"else"
|
|
|
|
"elif"
|
2023-03-05 22:41:18 +04:00
|
|
|
] @keyword.control.conditional
|
|
|
|
|
|
|
|
[
|
2022-04-15 19:35:23 +04:00
|
|
|
"while"
|
|
|
|
"for"
|
2023-03-05 22:41:18 +04:00
|
|
|
] @keyword.control.repeat
|
|
|
|
|
|
|
|
[
|
2022-04-15 19:35:23 +04:00
|
|
|
"return"
|
2023-03-05 22:41:18 +04:00
|
|
|
"pass"
|
2022-04-15 19:35:23 +04:00
|
|
|
"break"
|
|
|
|
"continue"
|
2023-03-05 22:41:18 +04:00
|
|
|
] @keyword.control.return
|
|
|
|
|
|
|
|
[
|
|
|
|
"func"
|
|
|
|
] @keyword.control.function
|
|
|
|
|
|
|
|
[
|
|
|
|
"export"
|
|
|
|
] @keyword.control.import
|
|
|
|
|
|
|
|
[
|
|
|
|
"in"
|
|
|
|
"is"
|
|
|
|
"as"
|
2022-04-15 19:35:23 +04:00
|
|
|
"match"
|
2023-03-05 22:41:18 +04:00
|
|
|
"and"
|
|
|
|
"or"
|
|
|
|
"not"
|
|
|
|
] @keyword.operator
|
|
|
|
|
|
|
|
[
|
|
|
|
"var"
|
2022-04-15 19:35:23 +04:00
|
|
|
"class"
|
|
|
|
"class_name"
|
|
|
|
"enum"
|
2023-03-05 22:41:18 +04:00
|
|
|
] @keyword.storage.type
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
(remote_keyword)
|
|
|
|
(static_keyword)
|
|
|
|
"const"
|
2022-04-15 19:35:23 +04:00
|
|
|
"signal"
|
2023-03-05 22:41:18 +04:00
|
|
|
"@"
|
|
|
|
] @keyword.storage.modifier
|
|
|
|
|
|
|
|
[
|
|
|
|
"setget"
|
2022-04-15 19:35:23 +04:00
|
|
|
"onready"
|
|
|
|
"extends"
|
2023-03-05 22:41:18 +04:00
|
|
|
"set"
|
|
|
|
"get"
|
2022-04-15 19:35:23 +04:00
|
|
|
] @keyword
|
2023-03-05 22:41:18 +04:00
|
|
|
|