Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | runtime/queries/c/highlights.scm | 17 | ||||
| -rw-r--r-- | runtime/queries/cpp/highlights.scm | 20 | ||||
| -rw-r--r-- | runtime/queries/python/highlights.scm | 4 |
3 files changed, 25 insertions, 16 deletions
diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm index e48e45ab..00d01e08 100644 --- a/runtime/queries/c/highlights.scm +++ b/runtime/queries/c/highlights.scm @@ -14,8 +14,6 @@ ] @keyword.storage.type [ - "extern" - "register" (type_qualifier) (storage_class_specifier) ] @keyword.storage.modifier @@ -55,8 +53,11 @@ (preproc_directive) ] @keyword.directive -(pointer_declarator "*" @type.builtin) -(abstract_pointer_declarator "*" @type.builtin) +"..." @punctuation + +["," "." ":" "::" ";" "->"] @punctuation.delimiter + +["(" ")" "[" "]" "{" "}" "[[" "]]"] @punctuation.bracket [ "+" @@ -95,13 +96,11 @@ "?" ] @operator -(conditional_expression ":" @operator) +(conditional_expression ":" @operator) ; After punctuation -"..." @punctuation - -["," "." ":" ";" "->" "::"] @punctuation.delimiter +(pointer_declarator "*" @type.builtin) ; After Operators +(abstract_pointer_declarator "*" @type.builtin) -["(" ")" "[" "]" "{" "}"] @punctuation.bracket [(true) (false)] @constant.builtin.boolean diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm index 2224dbc1..3493ba34 100644 --- a/runtime/queries/cpp/highlights.scm +++ b/runtime/queries/cpp/highlights.scm @@ -23,11 +23,6 @@ ; Functions -; These casts are parsed as function calls, but are not. -((identifier) @keyword (#eq? @keyword "static_cast")) -((identifier) @keyword (#eq? @keyword "dynamic_cast")) -((identifier) @keyword (#eq? @keyword "reinterpret_cast")) -((identifier) @keyword (#eq? @keyword "const_cast")) (call_expression function: (qualified_identifier @@ -39,6 +34,8 @@ (template_method name: (field_identifier) @function) +; Support up to 3 levels of nesting of qualifiers +; i.e. a::b::c::func(); (function_declarator declarator: (qualified_identifier name: (identifier) @function)) @@ -49,6 +46,12 @@ name: (identifier) @function))) (function_declarator + declarator: (qualified_identifier + name: (qualified_identifier + name: (qualified_identifier + name: (identifier) @function)))) + +(function_declarator declarator: (field_identifier) @function) ; Parameters @@ -72,6 +75,13 @@ "()" ] @operator + +; These casts are parsed as function calls, but are not. +((identifier) @keyword (#eq? @keyword "static_cast")) +((identifier) @keyword (#eq? @keyword "dynamic_cast")) +((identifier) @keyword (#eq? @keyword "reinterpret_cast")) +((identifier) @keyword (#eq? @keyword "const_cast")) + [ "co_await" "co_return" diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 0f34db96..a8ec18c8 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -131,8 +131,8 @@ "try" "except" "finally" -] @keyword.control.except -(raise_statement "from" @keyword.control.except) +] @keyword.control.exception +(raise_statement "from" @keyword.control.exception) ; Functions [ |