tree-sitter/script/generate-fixtures-wasm

26 lines
455 B
Text
Raw Normal View History

2019-01-14 14:39:01 -08:00
#!/usr/bin/env bash
set -e
cargo build --release
2019-01-14 14:39:01 -08:00
root_dir=$PWD
tree_sitter=${root_dir}/target/release/tree-sitter
grammars_dir=${root_dir}/test/fixtures/grammars
grammar_names=(
2019-04-26 19:13:32 -07:00
c
2019-01-14 14:39:01 -08:00
javascript
python
)
if [[ "$#" > 0 ]]; then
grammar_names=($1)
fi
2019-04-25 17:27:24 -07:00
for grammar_name in ${grammar_names[@]}; do
echo "Compiling ${grammar_name} parser to wasm"
$tree_sitter build-wasm ${grammars_dir}/${grammar_name}
2019-01-14 14:39:01 -08:00
done
2019-04-25 17:27:24 -07:00
2019-04-26 19:13:32 -07:00
mv tree-sitter-*.wasm target/release/