mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(lang): add make
This commit is contained in:
parent
225cac5e6b
commit
567c644e53
3 changed files with 119 additions and 0 deletions
|
|
@ -791,6 +791,7 @@ list.http = {
|
|||
},
|
||||
maintainers = { "@NTBBloodbath" },
|
||||
}
|
||||
|
||||
list.prisma = {
|
||||
install_info = {
|
||||
url = "https://github.com/victorhqc/tree-sitter-prisma",
|
||||
|
|
@ -800,6 +801,15 @@ list.prisma = {
|
|||
maintainers = { "@elianiva" },
|
||||
}
|
||||
|
||||
list.make = {
|
||||
install_info = {
|
||||
url = "https://github.com/alemuller/tree-sitter-make",
|
||||
branch = "main",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@lewis6991" },
|
||||
}
|
||||
|
||||
local M = {
|
||||
list = list,
|
||||
}
|
||||
|
|
|
|||
105
queries/make/highlights.scm
Normal file
105
queries/make/highlights.scm
Normal file
|
|
@ -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
|
||||
)
|
||||
4
queries/make/injections.scm
Normal file
4
queries/make/injections.scm
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(comment) @comment
|
||||
|
||||
(shell_text) @bash
|
||||
(shell_command) @bash
|
||||
Loading…
Add table
Add a link
Reference in a new issue