From 5ac8cf8ee596ddc29e0392e1ed28dbc5f10245d8 Mon Sep 17 00:00:00 2001 From: Tyler Miller Date: Thu, 1 Jun 2023 02:38:29 -0700 Subject: fix(make/highlights): add `define` and operators --- queries/make/highlights.scm | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/queries/make/highlights.scm b/queries/make/highlights.scm index f94c567b2..17a100edf 100644 --- a/queries/make/highlights.scm +++ b/queries/make/highlights.scm @@ -37,18 +37,35 @@ (include_directive ["include" "-include"] @include) (variable_assignment - (word) @symbol) -(variable_assignment [ - "?=" - ":=" - "+=" - "=" + name: (word) @symbol + [ + "?=" + ":=" + "::=" +; ":::=" + "+=" + "=" ] @operator) +(shell_assignment + name: (word) @symbol + "!=" @operator) + +(define_directive + "define" @keyword + name: (word) @symbol + [ + "=" + ":=" + "::=" +; ":::=" + "?=" + "!=" + ]? @operator + "endef" @keyword) (variable_assignment - (word) @variable.builtin - (#any-of? @variable.builtin + (word) @variable.builtin (#any-of? @variable.builtin ".DEFAULT_GOAL" ".EXTRA_PREREQS" ".FEATURES" @@ -65,11 +82,9 @@ "SHELL" )) - ; Use string to match bash (variable_reference (word) @string) @operator - (shell_function ["$" "(" ")"] @operator "shell" @function.builtin) -- cgit v1.2.3-70-g09d2