Get logging flags working properly with test script

This commit is contained in:
Max Brunsfeld 2019-01-14 17:19:46 -08:00
parent b1fa49448d
commit 5c3c1dd0bd
19 changed files with 140 additions and 225 deletions

17
script/generate-bindings Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
output_path=lib/binding/bindings.rs
header_path='lib/include/tree_sitter/api.h'
bindgen \
--no-layout-tests \
--whitelist-type '^TS.*' \
--whitelist-function '^ts_.*' \
--opaque-type FILE \
--distrust-clang-mangling \
$header_path > $output_path
echo "" >> $output_path
version_constant='TREE_SITTER_LANGUAGE_VERSION'
version_number=$(egrep "#define $version_constant (.*)" $header_path | cut -d' ' -f3)
echo "pub const $version_constant: usize = $version_number;" >> $output_path