From 70aee901ac78c3071271aafca37ba80072b243c9 Mon Sep 17 00:00:00 2001 From: Hendrik van Antwerpen Date: Tue, 11 Jan 2022 18:20:24 +0100 Subject: [PATCH] Reduce error handling logic --- lib/src/query.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/src/query.c b/lib/src/query.c index f0f02822..f42e6c77 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -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; }