diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2021-12-14 10:47:47 +0000 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-12-14 14:59:38 +0100 |
| commit | 567c644e5372d661ed36937ce7db6dc7155d97d1 (patch) | |
| tree | 9ed0e4c0e97d03bbc027b24085536dc11bcd1eab /queries/make | |
| parent | injections(rust): inject regex into `Regex::new` (diff) | |
| download | nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar.gz nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar.bz2 nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar.lz nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar.xz nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.tar.zst nvim-treesitter-567c644e5372d661ed36937ce7db6dc7155d97d1.zip | |
feat(lang): add make
Diffstat (limited to 'queries/make')
| -rw-r--r-- | queries/make/highlights.scm | 105 | ||||
| -rw-r--r-- | queries/make/injections.scm | 4 |
2 files changed, 109 insertions, 0 deletions
diff --git a/queries/make/highlights.scm b/queries/make/highlights.scm new file mode 100644 index 000000000..ee4b83a24 --- /dev/null +++ b/queries/make/highlights.scm @@ -0,0 +1,105 @@ +(comment) @comment + +(conditional + (_ [ + "ifeq" + "else" + "ifneq" + "ifdef" + "ifndef" + ] @conditional) + "endif" @conditional) + +(rule (targets + (word) @function.builtin + (#any-of? @function.builtin + ".PHONY" + ".SUFFIXES"))) + +(rule ["&:" ":" "::"] @operator) + +(export_directive "export" @keyword) +(override_directive "override" @keyword) +(include_directive ["include" "-include"] @include) + +(variable_assignment + (word) @symbol) +(variable_assignment [ + "?=" + ":=" + "+=" + "=" + ] @operator) + + +(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" + ) + ) + + + +; Use string to match bash +(variable_reference (word) @string ) @operator + + +(shell_function + ["$" "(" ")"] @operator + "shell" @function.builtin + ) + +(function_call ["$" "(" ")"] @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 +) diff --git a/queries/make/injections.scm b/queries/make/injections.scm new file mode 100644 index 000000000..3add7f494 --- /dev/null +++ b/queries/make/injections.scm @@ -0,0 +1,4 @@ +(comment) @comment + +(shell_text) @bash +(shell_command) @bash |
