helix-mirror/runtime/queries/wgsl/highlights.scm

115 lines
1.8 KiB
Scheme
Raw Normal View History

2022-10-01 02:43:07 +04:00
(int_literal) @constant.numeric.integer
(float_literal) @constant.numeric.float
(bool_literal) @constant.builtin.boolean
2021-11-27 06:19:40 +04:00
2022-10-01 02:43:07 +04:00
(global_constant_declaration) @variable
(global_variable_declaration) @variable
(compound_statement) @variable
(const_expression) @function
(variable_identifier_declaration
(identifier) @variable
(type_declaration) @type)
2021-11-27 06:19:40 +04:00
(function_declaration
2022-10-01 02:43:07 +04:00
(identifier) @function
(function_return_type_declaration
(type_declaration) @type))
(parameter
(variable_identifier_declaration
(identifier) @variable.parameter
(type_declaration) @type))
2021-11-27 06:19:40 +04:00
(struct_declaration
(identifier) @type)
2022-10-01 02:43:07 +04:00
(struct_declaration
(struct_member
(variable_identifier_declaration
(identifier) @variable.other.member
(type_declaration) @type)))
2021-11-27 06:19:40 +04:00
(type_constructor_or_function_call_expression
(type_declaration) @function)
[
"struct"
"bitcast"
"discard"
"enable"
"fallthrough"
"fn"
"let"
"private"
"read"
"read_write"
"storage"
"type"
"uniform"
"var"
"workgroup"
"write"
2022-10-01 02:43:07 +04:00
"override"
2021-11-27 06:19:40 +04:00
(texel_format)
2022-10-01 02:43:07 +04:00
] @keyword
2021-11-27 06:19:40 +04:00
2022-10-01 02:43:07 +04:00
"fn" @keyword.function
2021-11-27 06:19:40 +04:00
2022-10-01 02:43:07 +04:00
"return" @keyword.control.return
2021-11-27 06:19:40 +04:00
2022-10-01 02:43:07 +04:00
["," "." ":" ";"] @punctuation.delimiter
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
2021-11-27 06:19:40 +04:00
[
"loop"
"for"
2022-10-01 02:43:07 +04:00
"while"
2021-11-27 06:19:40 +04:00
"break"
"continue"
"continuing"
] @keyword.control.repeat
[
"if"
"else"
"switch"
"case"
"default"
] @keyword.control.conditional
[
"&"
"&&"
"/"
"!"
"="
"=="
"!="
">"
">="
">>"
"<"
"<="
"<<"
"%"
"-"
"+"
"|"
"||"
"*"
"~"
"^"
2022-10-01 02:43:07 +04:00
"@"
"++"
"--"
2021-11-27 06:19:40 +04:00
] @operator
(attribute
2022-10-01 02:43:07 +04:00
(identifier) @attribute)
2021-11-27 06:19:40 +04:00
(comment) @comment
(ERROR) @error