2022-05-28 21:46:10 +02:00
|
|
|
(parameter_declaration
|
|
|
|
name: (identifier) @variable.parameter)
|
|
|
|
(function_declaration
|
|
|
|
name: (identifier) @function)
|
|
|
|
(function_declaration
|
|
|
|
receiver: (parameter_list)
|
|
|
|
name: (identifier) @function.method)
|
|
|
|
|
|
|
|
(call_expression
|
|
|
|
function: (identifier) @function)
|
|
|
|
(call_expression
|
|
|
|
function: (selector_expression
|
|
|
|
field: (identifier) @function.method))
|
|
|
|
|
|
|
|
(field_identifier) @variable.other.member
|
|
|
|
(selector_expression
|
2023-03-15 22:22:24 +01:00
|
|
|
operand: (identifier) @variable
|
2022-05-28 21:46:10 +02:00
|
|
|
field: (identifier) @variable.other.member)
|
|
|
|
|
|
|
|
(int_literal) @constant.numeric.integer
|
2023-03-15 22:22:24 +01:00
|
|
|
|
|
|
|
(attribute_declaration) @attribute
|
|
|
|
(comment) @comment
|
|
|
|
[
|
|
|
|
(c_string_literal)
|
|
|
|
(raw_string_literal)
|
|
|
|
(interpreted_string_literal)
|
|
|
|
(string_interpolation)
|
|
|
|
(rune_literal)
|
|
|
|
] @string
|
|
|
|
|
2022-05-28 21:46:10 +02:00
|
|
|
(escape_sequence) @constant.character.escape
|
|
|
|
|
|
|
|
[
|
|
|
|
(pointer_type)
|
|
|
|
(array_type)
|
|
|
|
] @type
|
|
|
|
|
2023-03-15 22:22:24 +01:00
|
|
|
(const_spec name: (identifier) @constant)
|
|
|
|
(global_var_type_initializer name: (identifier) @constant)
|
|
|
|
(global_var_spec name: (identifier) @constant)
|
|
|
|
((identifier) @constant (#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
(generic_type)
|
|
|
|
(type_identifier)
|
|
|
|
] @constructor
|
|
|
|
|
|
|
|
(builtin_type) @type.builtin
|
|
|
|
|
|
|
|
[
|
|
|
|
(true)
|
|
|
|
(false)
|
|
|
|
] @constant.builtin.boolean
|
|
|
|
|
|
|
|
|
2022-05-28 21:46:10 +02:00
|
|
|
[
|
|
|
|
(module_identifier)
|
|
|
|
(import_path)
|
2023-03-15 22:22:24 +01:00
|
|
|
] @namespace
|
|
|
|
|
|
|
|
[
|
|
|
|
(pseudo_comptime_identifier)
|
|
|
|
(label_name)
|
|
|
|
] @label
|
|
|
|
|
|
|
|
[
|
|
|
|
(identifier)
|
2022-05-28 21:46:10 +02:00
|
|
|
] @variable
|
|
|
|
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2022-05-28 21:46:10 +02:00
|
|
|
[
|
2023-03-15 22:22:24 +01:00
|
|
|
"pub"
|
|
|
|
"assert"
|
|
|
|
"go"
|
|
|
|
"asm"
|
|
|
|
"defer"
|
|
|
|
"unsafe"
|
|
|
|
"sql"
|
|
|
|
(none)
|
2022-05-28 21:46:10 +02:00
|
|
|
] @keyword
|
|
|
|
|
|
|
|
[
|
2023-03-15 22:22:24 +01:00
|
|
|
"interface"
|
|
|
|
"enum"
|
|
|
|
"type"
|
|
|
|
"union"
|
|
|
|
"struct"
|
|
|
|
"module"
|
|
|
|
] @keyword.storage.type
|
|
|
|
|
|
|
|
[
|
|
|
|
"static"
|
|
|
|
"const"
|
|
|
|
"__global"
|
|
|
|
] @keyword.storage.modifier
|
|
|
|
|
|
|
|
[
|
|
|
|
"mut"
|
|
|
|
] @keyword.storage.modifier.mut
|
|
|
|
|
|
|
|
[
|
|
|
|
"shared"
|
|
|
|
"lock"
|
|
|
|
"rlock"
|
|
|
|
"spawn"
|
|
|
|
] @keyword.control
|
|
|
|
|
|
|
|
[
|
|
|
|
"if"
|
|
|
|
"select"
|
|
|
|
"else"
|
|
|
|
"match"
|
|
|
|
] @keyword.control.conditional
|
|
|
|
|
|
|
|
[
|
|
|
|
"for"
|
|
|
|
] @keyword.control.repeat
|
|
|
|
|
|
|
|
[
|
|
|
|
"goto"
|
|
|
|
"return"
|
|
|
|
] @keyword.control.return
|
|
|
|
|
|
|
|
[
|
|
|
|
"fn"
|
|
|
|
] @keyword.control.function
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
"import"
|
|
|
|
] @keyword.control.import
|
|
|
|
|
|
|
|
[
|
|
|
|
"as"
|
|
|
|
"in"
|
|
|
|
"is"
|
|
|
|
"or"
|
|
|
|
] @keyword.operator
|
2022-05-28 21:46:10 +02:00
|
|
|
|
|
|
|
[
|
|
|
|
"."
|
|
|
|
","
|
|
|
|
":"
|
|
|
|
";"
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
[
|
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"{"
|
|
|
|
"}"
|
|
|
|
"["
|
|
|
|
"]"
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
(array) @punctuation.bracket
|
|
|
|
|
|
|
|
[
|
|
|
|
"++"
|
|
|
|
"--"
|
|
|
|
|
|
|
|
"+"
|
|
|
|
"-"
|
|
|
|
"*"
|
|
|
|
"/"
|
|
|
|
"%"
|
|
|
|
|
|
|
|
"~"
|
|
|
|
"&"
|
|
|
|
"|"
|
|
|
|
"^"
|
|
|
|
|
|
|
|
"!"
|
|
|
|
"&&"
|
|
|
|
"||"
|
|
|
|
"!="
|
|
|
|
|
|
|
|
"<<"
|
|
|
|
">>"
|
|
|
|
|
|
|
|
"<"
|
|
|
|
">"
|
|
|
|
"<="
|
|
|
|
">="
|
|
|
|
|
|
|
|
"+="
|
|
|
|
"-="
|
|
|
|
"*="
|
|
|
|
"/="
|
|
|
|
"&="
|
|
|
|
"|="
|
|
|
|
"^="
|
|
|
|
"<<="
|
|
|
|
">>="
|
|
|
|
|
|
|
|
"="
|
|
|
|
":="
|
|
|
|
"=="
|
|
|
|
|
|
|
|
"?"
|
|
|
|
"<-"
|
|
|
|
"$"
|
|
|
|
".."
|
|
|
|
"..."
|
|
|
|
] @operator
|