#!/bin/bash set -eu known_failures="$(cat script/known-failures.txt)" tree-sitter parse -q \ 'examples/**/*.cs' \ $(for file in $known_failures; do echo "!${file}"; done) example_count=$(find examples -name '*.cs' | wc -l) failure_count=$(wc -w <<< "$known_failures") success_count=$(( $example_count - $failure_count )) success_percent=$(bc -l <<< "100*${success_count}/${example_count}") printf \ "Successfully parsed %d of %d example files (%.1f%%)\n" \ $success_count $example_count $success_percent