Return informative error when load_language fails

This commit is contained in:
Max Brunsfeld 2023-11-26 10:41:33 -08:00
parent e9289d3b30
commit 6fd7a1e44e
8 changed files with 246 additions and 108 deletions

View file

@ -37,21 +37,7 @@ bindgen \
--blocklist-type '^__.*' \
--no-prepend-enum-name \
--no-copy "$no_copy" \
--blocklist-function ts_tree_print_dot_graph \
--size_t-is-usize \
$header_path \
-- \
-D TREE_SITTER_FEATURE_WASM \
> $output_path
echo "" >> $output_path
defines=(
TREE_SITTER_LANGUAGE_VERSION
TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION
)
for define in ${defines[@]}; do
define_value=$(egrep "#define $define (.*)" $header_path | cut -d' ' -f3)
echo "pub const $define: usize = $define_value;" >> $output_path
done