diff options
| author | Pham Huy Hoang <hoangtun0810@gmail.com> | 2024-01-06 15:05:50 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch) | |
| tree | 70bf645539882b88e6fa129cefd30986b89bbac3 /queries/make/highlights.scm | |
| parent | ci: add query lint job (diff) | |
| download | nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2 nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip | |
chore: query formatting
Diffstat (limited to 'queries/make/highlights.scm')
| -rw-r--r-- | queries/make/highlights.scm | 239 |
1 files changed, 123 insertions, 116 deletions
diff --git a/queries/make/highlights.scm b/queries/make/highlights.scm index e1d7aa4f7..1777aa610 100644 --- a/queries/make/highlights.scm +++ b/queries/make/highlights.scm @@ -1,140 +1,147 @@ (comment) @comment @spell (conditional - (_ [ - "ifeq" - "else" - "ifneq" - "ifdef" - "ifndef" - ] @keyword.conditional) - "endif" @keyword.conditional) + (_ + [ + "ifeq" + "else" + "ifneq" + "ifdef" + "ifndef" + ] @keyword.conditional) + "endif" @keyword.conditional) -(rule (targets (word) @function)) +(rule + (targets + (word) @function)) + +(rule + (targets) @_target + (prerequisites + (word) @function + (#eq? @_target ".PHONY"))) (rule - (targets) @_target - (prerequisites (word) @function - (#eq? @_target ".PHONY"))) + (targets + (word) @function.builtin + (#any-of? @function.builtin ".DEFAULT" ".SUFFIXES" ".DELETE_ON_ERROR" ".EXPORT_ALL_VARIABLES" ".IGNORE" ".INTERMEDIATE" ".LOW_RESOLUTION_TIME" ".NOTPARALLEL" ".ONESHELL" ".PHONY" ".POSIX" ".PRECIOUS" ".SECONDARY" ".SECONDEXPANSION" ".SILENT" ".SUFFIXES"))) -(rule (targets - (word) @function.builtin - (#any-of? @function.builtin - ".DEFAULT" - ".SUFFIXES" - ".DELETE_ON_ERROR" - ".EXPORT_ALL_VARIABLES" - ".IGNORE" - ".INTERMEDIATE" - ".LOW_RESOLUTION_TIME" - ".NOTPARALLEL" - ".ONESHELL" - ".PHONY" - ".POSIX" - ".PRECIOUS" - ".SECONDARY" - ".SECONDEXPANSION" - ".SILENT" - ".SUFFIXES"))) +(rule + [ + "&:" + ":" + "::" + ] @operator) + +(export_directive + "export" @keyword) -(rule ["&:" ":" "::"] @operator) +(override_directive + "override" @keyword) -(export_directive "export" @keyword) -(override_directive "override" @keyword) (include_directive - ["include" "-include"] @keyword.import - filenames: (list (word) @string.special.path)) + [ + "include" + "-include" + ] @keyword.import + filenames: + (list + (word) @string.special.path)) (variable_assignment - name: (word) @string.special.symbol - [ - "?=" - ":=" - "::=" -; ":::=" - "+=" - "=" - ] @operator) + name: (word) @string.special.symbol + [ + "?=" + ":=" + "::=" + ; ":::=" + "+=" + "=" + ] @operator) (shell_assignment - name: (word) @string.special.symbol - "!=" @operator) + name: (word) @string.special.symbol + "!=" @operator) (define_directive - "define" @keyword - name: (word) @string.special.symbol - [ - "=" - ":=" - "::=" -; ":::=" - "?=" - "!=" - ]? @operator - "endef" @keyword) + "define" @keyword + name: (word) @string.special.symbol + [ + "=" + ":=" + "::=" + ; ":::=" + "?=" + "!=" + ]? + @operator + "endef" @keyword) (variable_assignment - (word) @variable.builtin (#any-of? @variable.builtin - ".DEFAULT_GOAL" - ".EXTRA_PREREQS" - ".FEATURES" - ".INCLUDE_DIRS" - ".RECIPEPREFIX" - ".SHELLFLAGS" - ".VARIABLES" - "MAKEARGS" - "MAKEFILE_LIST" - "MAKEFLAGS" - "MAKE_RESTARTS" - "MAKE_TERMERR" - "MAKE_TERMOUT" - "SHELL" - )) + (word) @variable.builtin + (#any-of? @variable.builtin ".DEFAULT_GOAL" ".EXTRA_PREREQS" ".FEATURES" ".INCLUDE_DIRS" ".RECIPEPREFIX" ".SHELLFLAGS" ".VARIABLES" "MAKEARGS" "MAKEFILE_LIST" "MAKEFLAGS" "MAKE_RESTARTS" "MAKE_TERMERR" "MAKE_TERMOUT" "SHELL")) ; Use string to match bash -(variable_reference (word) @string) @operator +(variable_reference + (word) @string) @operator (shell_function - ["$" "(" ")"] @operator - "shell" @function.builtin) + [ + "$" + "(" + ")" + ] @operator + "shell" @function.builtin) + +(function_call + [ + "$" + "(" + ")" + ] @operator) -(function_call ["$" "(" ")"] @operator) -(substitution_reference ["$" "(" ")"] @operator) +(substitution_reference + [ + "$" + "(" + ")" + ] @operator) -(function_call [ - "subst" - "patsubst" - "strip" - "findstring" - "filter" - "filter-out" - "sort" - "word" - "words" - "wordlist" - "firstword" - "lastword" - "dir" - "notdir" - "suffix" - "basename" - "addsuffix" - "addprefix" - "join" - "wildcard" - "realpath" - "abspath" - "error" - "warning" - "info" - "origin" - "flavor" - "foreach" - "if" - "or" - "and" - "call" - "eval" - "file" - "value" - ] @function.builtin) +(function_call + [ + "subst" + "patsubst" + "strip" + "findstring" + "filter" + "filter-out" + "sort" + "word" + "words" + "wordlist" + "firstword" + "lastword" + "dir" + "notdir" + "suffix" + "basename" + "addsuffix" + "addprefix" + "join" + "wildcard" + "realpath" + "abspath" + "error" + "warning" + "info" + "origin" + "flavor" + "foreach" + "if" + "or" + "and" + "call" + "eval" + "file" + "value" + ] @function.builtin) |
