Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/v/highlights.scm')
| -rw-r--r-- | runtime/queries/v/highlights.scm | 225 |
1 files changed, 67 insertions, 158 deletions
diff --git a/runtime/queries/v/highlights.scm b/runtime/queries/v/highlights.scm index 9ae91d97..c71245dc 100644 --- a/runtime/queries/v/highlights.scm +++ b/runtime/queries/v/highlights.scm @@ -1,177 +1,84 @@ -[(line_comment) (block_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 - (parameter_declaration - name: (identifier) @variable.parameter) -(receiver - name: (identifier) @variable.parameter) + name: (identifier) @variable.parameter) (function_declaration - name: (identifier) @function) + name: (identifier) @function) (function_declaration - receiver: (receiver) - name: (identifier) @function.method) -(interface_method_definition - name: (identifier) @function.method) + receiver: (parameter_list) + name: (identifier) @function.method) (call_expression - name: (selector_expression - field: (reference_expression) @function.method)) - + function: (identifier) @function) (call_expression - name: (reference_expression) @function) - -(struct_declaration - name: (identifier) @type) - -(enum_declaration - name: (identifier) @type) - -(interface_declaration - name: (identifier) @type) - -(type_declaration - name: (identifier) @type) - -(struct_field_declaration - name: (identifier) @variable.other.member) - -(field_name) @variable.other.member + function: (selector_expression + field: (identifier) @function.method)) +(field_identifier) @variable.other.member (selector_expression - field: (reference_expression) @variable.other.member) + field: (identifier) @variable.other.member) (int_literal) @constant.numeric.integer +(interpreted_string_literal) @string +(rune_literal) @string (escape_sequence) @constant.character.escape [ - (c_string_literal) - (raw_string_literal) - (interpreted_string_literal) - (string_interpolation) - (rune_literal) -] @string - -(string_interpolation - (interpolation_opening) @punctuation.bracket - (interpolation_expression) @embedded - (interpolation_closing) @punctuation.bracket) - -(attribute) @attribute - -[ - (type_reference_expression) - ] @type + (type_identifier) + (builtin_type) + (pointer_type) + (array_type) +] @type + +[ + (identifier) + (module_identifier) + (import_path) +] @variable + +[ + "as" + "asm" + "assert" + ;"atomic" + ;"break" + "const" + ;"continue" + "defer" + "else" + "enum" + "fn" + "for" + "$for" + "go" + "goto" + "if" + "$if" + "import" + "in" + "!in" + "interface" + "is" + "!is" + "lock" + "match" + "module" + "mut" + "or" + "pub" + "return" + "rlock" + "select" + ;"shared" + ;"static" + "struct" + "type" + ;"union" + "unsafe" +] @keyword [ (true) (false) -] @constant.builtin.boolean - -[ - "pub" - "assert" - "asm" - "defer" - "unsafe" - "sql" - (nil) - (none) -] @keyword - -[ - "interface" - "enum" - "type" - "union" - "struct" - "module" -] @keyword.storage.type - -[ - "static" - "const" - "__global" -] @keyword.storage.modifier - -[ - "mut" -] @keyword.storage.modifier.mut - -[ - "shared" - "lock" - "rlock" - "spawn" - "break" - "continue" - "go" -] @keyword.control - -[ - "if" - "$if" - "select" - "else" - "$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 +] @boolean [ "." @@ -189,7 +96,7 @@ "]" ] @punctuation.bracket -(array_creation) @punctuation.bracket +(array) @punctuation.bracket [ "++" @@ -239,3 +146,5 @@ ".." "..." ] @operator + +(comment) @comment
\ No newline at end of file |