Fix handling of alternations and optional nodes in query analysis

This commit is contained in:
Max Brunsfeld 2020-08-20 16:28:54 -07:00
parent 9daec9cb22
commit 456b1f6771
3 changed files with 190 additions and 52 deletions

View file

@ -83,10 +83,14 @@ done
shift $(expr $OPTIND - 1)
if [[ -n $TREE_SITTER_TEST_LANGUAGE_FILTER || -n $TREE_SITTER_TEST_EXAMPLE_FILTER || -n $TREE_SITTER_TEST_TRIAL_FILTER ]]; then
top_level_filter=corpus
else
top_level_filter=$1
top_level_filter=$1
if [[ \
-n $TREE_SITTER_TEST_LANGUAGE_FILTER || \
-n $TREE_SITTER_TEST_EXAMPLE_FILTER || \
-n $TREE_SITTER_TEST_TRIAL_FILTER \
]]; then
echo ${top_level_filter:=corpus}
fi
if [[ "${mode}" == "debug" ]]; then