Regenerate parsers on CI
This commit is contained in:
parent
19b2addcc4
commit
b1fa49448d
6 changed files with 70 additions and 32 deletions
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DIRS="${*:-src include}"
|
||||
|
||||
find $DIRS \
|
||||
-name '*.c' -or -name '*.cc' -or -name '*.h' | \
|
||||
xargs clang-format -i -style=file
|
||||
14
script/lint
14
script/lint
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
CPPLINT=externals/cpplint.py
|
||||
CPPLINT_URL=http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
|
||||
|
||||
if [[ ! -f $CPPLINT ]]; then
|
||||
curl $CPPLINT_URL > $CPPLINT
|
||||
chmod +x $CPPLINT
|
||||
fi
|
||||
|
||||
FILTERS='--filter=-legal/copyright,-readability/todo,-build/c++11'
|
||||
|
||||
$CPPLINT --linelength=90 --root=include $FILTERS include/tree_sitter/compiler.h 2>&1
|
||||
$CPPLINT --linelength=90 --root=src $FILTERS $(find src/compiler -type f) 2>&1
|
||||
27
script/regenerate-fixtures
Executable file
27
script/regenerate-fixtures
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
root_dir=$PWD
|
||||
tree_sitter=${root_dir}/target/release/tree-sitter
|
||||
grammars_dir=${root_dir}/test/fixtures/grammars
|
||||
|
||||
grammar_names=(
|
||||
bash
|
||||
c
|
||||
cpp
|
||||
embedded-template
|
||||
go
|
||||
html
|
||||
javascript
|
||||
json
|
||||
python
|
||||
rust
|
||||
)
|
||||
|
||||
for grammar_name in "${grammar_names[@]}"; do
|
||||
echo "Regenerating ${grammar_name} parser"
|
||||
cd ${grammars_dir}/${grammar_name}
|
||||
$tree_sitter generate src/grammar.json
|
||||
cd $PWD
|
||||
done
|
||||
22
script/regenerate-fixtures.cmd
Normal file
22
script/regenerate-fixtures.cmd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@echo off
|
||||
|
||||
call:regenerate bash
|
||||
call:regenerate c
|
||||
call:regenerate cpp
|
||||
call:regenerate embedded-template
|
||||
call:regenerate go
|
||||
call:regenerate html
|
||||
call:regenerate javascript
|
||||
call:regenerate json
|
||||
call:regenerate python
|
||||
call:regenerate rust
|
||||
EXIT /B 0
|
||||
|
||||
:regenerate
|
||||
SETLOCAL
|
||||
SET tree_sitter=%cd%\target\release\tree-sitter
|
||||
SET grammar_dir=test\fixtures\grammars\%~1
|
||||
pushd %grammar_dir%
|
||||
%tree_sitter% generate src\grammar.json
|
||||
popd
|
||||
EXIT /B 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue