Skip to content

Commit

Permalink
chore: Remove vsql/grammar.v (#172)
Browse files Browse the repository at this point in the history
This is a generated file. I kept it in initially so it didn't need to be
generated but that doesn't need to be the case anymore.
  • Loading branch information
elliotchance authored Oct 31, 2023
1 parent 6d9a2d5 commit 3c266d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15,996 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ jobs:
- name: Build Windows binaries
run: |
brew install mingw-w64
v -os windows -prod cmd/vsql
mv cmd/vsql/vsql.exe bin/vsql.exe
make bin/vsql.exe
zip -j vsql-windows.zip bin/vsql.exe
- name: Release
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ vsql-server
.vscode
.vlang_tmp_build/
grammar.bnf

vsql/grammar.v
scripts/generate-v-client-library-docs
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: bench bench-on-disk bench-memory fmt fmt-verify test examples grammar sql-test docs clean-docs oldv
.PHONY: bench bench-on-disk bench-memory fmt fmt-verify test examples clean-grammar grammar sql-test docs clean-docs oldv

# Is not used at the moment. It is useful for testing options like different
# `-gc` values.
Expand All @@ -23,16 +23,16 @@ ready: grammar fmt snippets

# Binaries

bin/vsql:
bin/vsql: vsql/grammar.v
mkdir -p bin
v $(BUILD_OPTIONS) $(PROD) cmd/vsql -o bin/vsql

bin/vsql.exe:
bin/vsql.exe: vsql/grammar.v
mkdir -p bin
v $(BUILD_OPTIONS) $(PROD) cmd/vsql
v -os windows $(BUILD_OPTIONS) $(PROD) cmd/vsql
mv cmd/vsql/vsql.exe bin/vsql.exe

oldv:
oldv: vsql/grammar.v
ifdef OLDV
@mkdir -p /tmp/oldv/
@# VJOBS and VFLAGS needs to be provided for macOS. I'm not sure if they also
Expand All @@ -56,11 +56,18 @@ clean-docs:

# Grammar (BNF)

grammar:
grammar.bnf:
grep "//~" -r vsql | cut -d~ -f2 > grammar.bnf

vsql/grammar.v: grammar.bnf
python3 generate-grammar.py
v fmt -w vsql/grammar.v

clean-grammar:
rm -f grammar.bnf vsql/grammar.v

grammar: clean-grammar vsql/grammar.v

# Formatting

fmt:
Expand Down Expand Up @@ -97,7 +104,7 @@ examples:
echo $$f; v run $$f || exit 1; \
done

examples/%:
examples/%: vsql/grammar.v
v run examples/$*.v

# Benchmarking
Expand Down
Loading

0 comments on commit 3c266d1

Please sign in to comment.