feat(lang): add make

This commit is contained in:
Lewis Russell 2021-12-14 10:47:47 +00:00 committed by Stephan Seitz
parent 225cac5e6b
commit 567c644e53
3 changed files with 119 additions and 0 deletions

View file

@ -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
View 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
)

View file

@ -0,0 +1,4 @@
(comment) @comment
(shell_text) @bash
(shell_command) @bash