2023-07-31 01:04:55 +02:00
|
|
|
(comment) @comment
|
|
|
|
|
|
|
|
(module_clause
|
|
|
|
(identifier) @namespace)
|
|
|
|
|
|
|
|
(import_path
|
|
|
|
(import_name) @namespace)
|
|
|
|
|
|
|
|
(import_alias
|
|
|
|
(import_name) @namespace)
|
|
|
|
|
|
|
|
(enum_fetch
|
|
|
|
(reference_expression) @constant)
|
|
|
|
|
|
|
|
(enum_field_definition
|
|
|
|
(identifier) @constant)
|
|
|
|
|
|
|
|
(global_var_definition
|
|
|
|
(identifier) @constant)
|
|
|
|
|
|
|
|
(compile_time_if_expression
|
|
|
|
condition: (reference_expression) @constant)
|
|
|
|
|
|
|
|
(compile_time_if_expression
|
|
|
|
condition: (binary_expression
|
|
|
|
left: (reference_expression) @constant
|
|
|
|
right: (reference_expression) @constant))
|
|
|
|
|
|
|
|
(compile_time_if_expression
|
|
|
|
condition: (binary_expression
|
|
|
|
left: (reference_expression) @constant
|
|
|
|
right: (unary_expression (reference_expression) @constant)))
|
|
|
|
|
|
|
|
(label_reference) @label
|
|
|
|
|
2022-05-28 21:46:10 +02:00
|
|
|
(parameter_declaration
|
2023-07-31 01:04:55 +02:00
|
|
|
name: (identifier) @variable.parameter)
|
|
|
|
(receiver
|
|
|
|
name: (identifier) @variable.parameter)
|
2022-05-28 21:46:10 +02:00
|
|
|
(function_declaration
|
2023-07-31 01:04:55 +02:00
|
|
|
name: (identifier) @function)
|
2022-05-28 21:46:10 +02:00
|
|
|
(function_declaration
|
2023-07-31 01:04:55 +02:00
|
|
|
receiver: (receiver)
|
|
|
|
name: (identifier) @function.method)
|
|
|
|
(interface_method_definition
|
|
|
|
name: (identifier) @function.method)
|
2022-05-28 21:46:10 +02:00
|
|
|
|
|
|
|
(call_expression
|
2023-07-31 01:04:55 +02:00
|
|
|
name: (selector_expression
|
|
|
|
field: (reference_expression) @function.method))
|
2022-05-28 21:46:10 +02:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(call_expression
|
|
|
|
name: (reference_expression) @function)
|
2022-05-28 21:46:10 +02:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(struct_declaration
|
|
|
|
name: (identifier) @type)
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(enum_declaration
|
|
|
|
name: (identifier) @type)
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(interface_declaration
|
|
|
|
name: (identifier) @type)
|
2022-05-28 21:46:10 +02:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(type_declaration
|
|
|
|
name: (identifier) @type)
|
2022-05-28 21:46:10 +02:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(struct_field_declaration
|
|
|
|
name: (identifier) @variable.other.member)
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(field_name) @variable.other.member
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(selector_expression
|
|
|
|
field: (reference_expression) @variable.other.member)
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(int_literal) @constant.numeric.integer
|
|
|
|
(escape_sequence) @constant.character.escape
|
2023-03-15 22:22:24 +01:00
|
|
|
|
|
|
|
[
|
2023-07-31 01:04:55 +02:00
|
|
|
(c_string_literal)
|
|
|
|
(raw_string_literal)
|
|
|
|
(interpreted_string_literal)
|
|
|
|
(string_interpolation)
|
|
|
|
(rune_literal)
|
|
|
|
] @string
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(string_interpolation
|
|
|
|
(braced_interpolation_opening) @punctuation.bracket
|
|
|
|
(interpolated_expression) @embedded
|
|
|
|
(braced_interpolation_closing) @punctuation.bracket)
|
2023-03-15 22:22:24 +01:00
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(attribute) @attribute
|
2023-03-15 22:22:24 +01:00
|
|
|
|
|
|
|
[
|
2023-07-31 01:04:55 +02:00
|
|
|
(type_reference_expression)
|
|
|
|
] @type
|
2023-03-15 22:22:24 +01:00
|
|
|
|
|
|
|
[
|
2023-07-31 01:04:55 +02:00
|
|
|
(true)
|
|
|
|
(false)
|
|
|
|
] @constant.builtin.boolean
|
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"
|
|
|
|
"asm"
|
|
|
|
"defer"
|
|
|
|
"unsafe"
|
|
|
|
"sql"
|
2023-07-31 01:04:55 +02:00
|
|
|
(nil)
|
2023-03-15 22:22:24 +01:00
|
|
|
(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"
|
2023-07-31 01:04:55 +02:00
|
|
|
"break"
|
|
|
|
"continue"
|
|
|
|
"go"
|
2023-03-15 22:22:24 +01:00
|
|
|
] @keyword.control
|
|
|
|
|
|
|
|
[
|
|
|
|
"if"
|
2023-07-31 01:04:55 +02:00
|
|
|
"$if"
|
2023-03-15 22:22:24 +01:00
|
|
|
"select"
|
|
|
|
"else"
|
2023-07-31 01:04:55 +02:00
|
|
|
"$else"
|
2023-03-15 22:22:24 +01:00
|
|
|
"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
|
|
|
|
|
2023-07-31 01:04:55 +02:00
|
|
|
(array_creation) @punctuation.bracket
|
2022-05-28 21:46:10 +02:00
|
|
|
|
|
|
|
[
|
|
|
|
"++"
|
|
|
|
"--"
|
|
|
|
|
|
|
|
"+"
|
|
|
|
"-"
|
|
|
|
"*"
|
|
|
|
"/"
|
|
|
|
"%"
|
|
|
|
|
|
|
|
"~"
|
|
|
|
"&"
|
|
|
|
"|"
|
|
|
|
"^"
|
|
|
|
|
|
|
|
"!"
|
|
|
|
"&&"
|
|
|
|
"||"
|
|
|
|
"!="
|
|
|
|
|
|
|
|
"<<"
|
|
|
|
">>"
|
|
|
|
|
|
|
|
"<"
|
|
|
|
">"
|
|
|
|
"<="
|
|
|
|
">="
|
|
|
|
|
|
|
|
"+="
|
|
|
|
"-="
|
|
|
|
"*="
|
|
|
|
"/="
|
|
|
|
"&="
|
|
|
|
"|="
|
|
|
|
"^="
|
|
|
|
"<<="
|
|
|
|
">>="
|
|
|
|
|
|
|
|
"="
|
|
|
|
":="
|
|
|
|
"=="
|
|
|
|
|
|
|
|
"?"
|
|
|
|
"<-"
|
|
|
|
"$"
|
|
|
|
".."
|
|
|
|
"..."
|
|
|
|
] @operator
|