Reduce error handling logic

This commit is contained in:
Hendrik van Antwerpen 2022-01-11 18:20:24 +01:00
parent acd3d32c36
commit 70aee901ac

View file

@ -2291,12 +2291,9 @@ static TSQueryError ts_query__parse_pattern(
is_immediate,
&field_capture_quantifiers
);
if (e == PARENT_DONE) {
capture_quantifiers_delete(&field_capture_quantifiers);
return TSQueryErrorSyntax;
}
if (e) {
capture_quantifiers_delete(&field_capture_quantifiers);
if (e == PARENT_DONE) e = TSQueryErrorSyntax;
return e;
}