Skip to content

Commit

Permalink
chore: remove deprecated query parsing mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 13, 2024
1 parent 5ea0dbf commit da0596b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/binding_web/test/query-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Expand Down
9 changes: 1 addition & 8 deletions lib/src/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit da0596b

Please sign in to comment.