queries: update more grammars

This commit is contained in:
Blaž Hrastnik 2024-05-22 01:06:08 +09:00
parent b7656e0079
commit b13999952f
8 changed files with 39 additions and 32 deletions

View File

@ -109,14 +109,15 @@
(number) @constant.numeric
(string) @string
(func_call name: (identifier) @function)
(func_def name: (identifier) @function)
(field_ref (_) @variable)
[
(identifier)
(field_ref)
] @variable
(func_call name: (identifier) @function)
(func_def name: (identifier) @function)
(field_ref (_) @variable)
(ns_qualified_name "::" @operator)
(ns_qualified_name (namespace) @namespace)

View File

@ -46,6 +46,9 @@
(comment) @comment
((word) @constant.builtin.boolean
(#any-of? @constant.builtin.boolean "true" "false"))
(function_definition name: (word) @function)
(file_descriptor) @constant.numeric.integer

View File

@ -1,3 +1,9 @@
(identifier) @variable
((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
"sizeof" @keyword
[
@ -109,6 +115,12 @@
(char_literal) @constant.character
(escape_sequence) @constant.character.escape
(field_identifier) @variable.other.member
(statement_identifier) @label
(type_identifier) @type
(primitive_type) @type.builtin
(sized_type_specifier) @type.builtin
(call_expression
function: (identifier) @function)
(call_expression
@ -128,15 +140,4 @@
(attribute
name: (identifier) @attribute)
(field_identifier) @variable.other.member
(statement_identifier) @label
(type_identifier) @type
(primitive_type) @type.builtin
(sized_type_specifier) @type.builtin
((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
(identifier) @variable
(comment) @comment

View File

@ -10,6 +10,14 @@
(comment) @comment
;; other symbols
(sym_lit) @variable
;; other calls
(list_lit
.
(sym_lit) @function)
;; metadata experiment
(meta_lit
marker: "^" @punctuation)
@ -61,20 +69,12 @@
((sym_lit) @operator
(#match? @operator "^%"))
;; other calls
(list_lit
.
(sym_lit) @function)
;; interop-ish
(list_lit
.
(sym_lit) @function.method
(#match? @function.method "^\\."))
;; other symbols
(sym_lit) @variable
;; quote
(quoting_lit) @constant.character.escape

View File

@ -1,3 +1,5 @@
; inherits: c
; Functions
; These casts are parsed as function calls, but are not.
@ -132,5 +134,3 @@
; Strings
(raw_string_literal) @string
; inherits: c

View File

@ -1,3 +1,5 @@
(identifier) @variable
; Methods
(method_declaration
@ -54,8 +56,6 @@
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
(identifier) @variable
(this) @variable.builtin
; Literals

View File

@ -23,12 +23,16 @@
(borrow_expression "&" @keyword.storage.modifier.ref)
(borrow_expression "&mut" @keyword.storage.modifier.mut)
(identifier) @variable
(constant_identifier) @constant
((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
(function_identifier) @function
(primitive_type) @type.builtin
(struct_identifier) @type
(pack_expression
access: (module_access
@ -152,6 +156,3 @@
"with"
] @keyword
(primitive_type) @type.buildin
(identifier) @variable

View File

@ -3,13 +3,14 @@
(boolean) @constant.builtin.boolean
(include_path) @string.special.path
(identifier) @variable
(parameters_declaration (identifier) @variable.parameter)
(function_declaration name: (identifier) @function)
(function_call function: (identifier) @function)
(module_call name: (identifier) @function)
(identifier) @variable
(special_variable) @variable.builtin
[