tree-sitter/script/generate-fixtures-wasm

22 lines
440 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
2019-05-01 11:29:35 -07:00
grammar_names=$(ls $grammars_dir)
2019-01-14 14:39:01 -08:00
if [[ "$#" > 0 ]]; then
grammar_names=($1)
fi
2019-05-01 11:29:35 -07:00
for grammar_name in $grammar_names; do
2019-04-25 17:27:24 -07:00
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/