2023-01-05 18:08:21 +03:00
|
|
|
TS_CONF := $$HOME/.config/tree-sitter/config.json
|
2021-08-21 20:15:42 +03:00
|
|
|
|
2023-01-05 18:08:21 +03:00
|
|
|
test: build
|
|
|
|
tree-sitter test
|
|
|
|
|
|
|
|
highlight: build
|
|
|
|
tree-sitter highlight -t test/highlight/*
|
|
|
|
|
|
|
|
playground: build-wasm
|
|
|
|
tree-sitter playground --quiet
|
|
|
|
|
|
|
|
build-wasm: build
|
|
|
|
tree-sitter build-wasm
|
|
|
|
|
|
|
|
build:
|
2021-08-21 20:15:42 +03:00
|
|
|
tree-sitter generate
|
|
|
|
|
2023-01-05 18:08:21 +03:00
|
|
|
init: init-tree-sitter init-git-hooks
|
|
|
|
|
|
|
|
init-tree-sitter:
|
|
|
|
if [ ! -f "$(TS_CONF)" ]; then \
|
|
|
|
tree-sitter init-config; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $$(jq '."parser-directories"' $(TS_CONF) | grep $$(dirname $$PWD) ) ]; then \
|
|
|
|
cat <<< $$(jq ".\"parser-directories\" |= . + [\"$$(dirname $(PWD))\"]" $(TS_CONF)) > $(TS_CONF); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
init-git-hooks:
|
|
|
|
ln -s $(PWD)/scripts/pre-commit $(PWD)/.git/hooks/pre-commit
|
2021-08-21 20:15:42 +03:00
|
|
|
|
2023-01-05 18:08:21 +03:00
|
|
|
help:
|
|
|
|
cat Makefile
|