Handle multiple top-level alternations correctly

This commit is contained in:
Hendrik van Antwerpen 2022-01-11 18:06:28 +01:00
parent 8b28f3a8c4
commit ec9b00e5c6
2 changed files with 19 additions and 1 deletions

View file

@ -1990,7 +1990,7 @@ static TSQueryError ts_query__parse_pattern(
return e;
}
if(start_index == 0) {
if(start_index == starting_step_index) {
capture_quantifiers_replace(capture_quantifiers, &branch_capture_quantifiers);
} else {
capture_quantifiers_join_all(capture_quantifiers, &branch_capture_quantifiers);