Fix tree-sitter generation with make

This commit is contained in:
Alexander Bantyev 2020-09-11 20:26:51 +03:00
parent 7f3a662cbc
commit 417b427f6d
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
7 changed files with 19 additions and 14 deletions

View File

@ -1,7 +1,3 @@
SITTER ?= tree-sitter
DIRS := pascaligo reasonligo camligo
PACKAGE := squirrel
STACK_DEV_OPTIONS = --fast --ghc-options -Wwarn --file-watch
@ -12,19 +8,13 @@ all: build
FORCE:
generate: $(DIRS)
$(DIRS): FORCE
# $(SITTER) generate # Generation is manual for now
# mkdir -p $(PACKAGE)/vendor/$@
# cp grammar/$@/src/parser.c vendor/$@/parser.c
# cp -r grammar/$@/src/tree_sitter vendor/$@/tree_sitter
grammar: ; $(MAKE) -C $@
clean:
$(RM) vendor/*
stack clean
build:
build: grammar
stack build $(STACK_DEV_OPTIONS)
.PHONY: all clean generate build FORCE
.PHONY: all clean grammar build FORCE

View File

@ -0,0 +1,7 @@
DIRS = $(wildcard */.)
generate: $(DIRS)
$(DIRS): ; $(MAKE) -C $@
.PHONY: generate $(DIRS)

View File

@ -0,0 +1 @@
include ../parser.mk

View File

@ -0,0 +1 @@
src/parser.c: grammar.js; tree-sitter generate

View File

@ -0,0 +1,5 @@
include ../parser.mk
test: src/parser.c; tree-sitter parse test.ligo
.PHONY: test

View File

@ -1 +0,0 @@
Some(Unit) # Some(Foo(Bar, Unit))

View File

@ -0,0 +1 @@
../../../../../src/test/examples/pascaligo/arithmetic-contract.ligo

View File

@ -0,0 +1 @@
include ../parser.mk