From cbfa53db225447ef9bc8f1ce20d210af447b53a6 Mon Sep 17 00:00:00 2001 From: Mateus Melchiades Date: Mon, 7 Mar 2022 11:02:25 -0300 Subject: highlights(vala): Reflect upstream refactor --- queries/vala/highlights.scm | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'queries') diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm index 912c7cad..d1be3253 100644 --- a/queries/vala/highlights.scm +++ b/queries/vala/highlights.scm @@ -1,15 +1,24 @@ +; Identifiers + +((identifier) @constant (#match? @constant "^[A-Z][A-Z\\d_]+$")) + (namespaced_identifier left: [ - (identifier) @namespace + ; Lowercased names in lhs typically are variables, while camel cased are namespaces + ; ((identifier) @namespace (#match? @namespace "^[A-Z]+[a-z]+$")) + ((identifier) @variable (#match? @variable "^[a-z]")) (_) ] right: [ - ((identifier) @constructor (#match? @constructor "^[A-Z]*[a-z]+")) - ((identifier) @constant (#match? @constant "^[A-Z][A-Z_]*")) + ; Lowercased are variables, camel cased are types + ; ((identifier) @parameter (#match? @parameter "^[a-z]")) + ((identifier) @type (#match? @type "^[A-Z]+[a-z]+$")) (_) ] ) +((identifier) @constructor (#match? @constructor "^[A-Z]*[a-z]+")) + ; Pointers (address_of_identifier "&" @symbol) @@ -155,9 +164,6 @@ name: [ (identifier) @method (generic_identifier (_) @type) - (namespaced_identifier - (_) @method . - ) ] ) @@ -165,9 +171,13 @@ identifier: [ (identifier) @method (generic_identifier (_) @type) - (namespaced_identifier - (_) @method . - ) + ] +) + +(member_function + identifier: [ + (identifier) @method + (generic_identifier (_) @type) ] ) -- cgit v1.2.3