From da0596ba3872a4bd06b663f5f01e92ae37113c58 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Tue, 13 Feb 2024 12:38:11 -0500 Subject: [PATCH] chore: remove deprecated query parsing mechanism --- lib/binding_web/test/query-test.js | 2 +- lib/src/query.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/binding_web/test/query-test.js b/lib/binding_web/test/query-test.js index 40913152..ec9882f1 100644 --- a/lib/binding_web/test/query-test.js +++ b/lib/binding_web/test/query-test.js @@ -46,7 +46,7 @@ describe('Query', () => { JavaScript.query('((identifier) @abc (#eq?))'); }, 'Wrong number of arguments to `#eq?` predicate. Expected 2, got 0'); assert.throws(() => { - JavaScript.query('((identifier) @a (eq? @a @a @a))'); + JavaScript.query('((identifier) @a (#eq? @a @a @a))'); }, 'Wrong number of arguments to `#eq?` predicate. Expected 2, got 3'); }); }); diff --git a/lib/src/query.c b/lib/src/query.c index 3b4ae901..fde77917 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -2312,15 +2312,8 @@ static TSQueryError ts_query__parse_pattern( stream_scan_identifier(stream); uint32_t length = (uint32_t)(stream->input - node_name); - // TODO - remove. - // For temporary backward compatibility, handle predicates without the leading '#' sign. - if (length > 0 && (node_name[length - 1] == '!' || node_name[length - 1] == '?')) { - stream_reset(stream, node_name); - return ts_query__parse_predicate(self, stream); - } - // Parse the wildcard symbol - else if (length == 1 && node_name[0] == '_') { + if (length == 1 && node_name[0] == '_') { symbol = WILDCARD_SYMBOL; }