tree-sitter / tree-sitter-python

Python grammar for tree-sitter
MIT License
360 stars 132 forks source link

Add alias for `not in` and `is not` #190

Closed tausbn closed 1 year ago

tausbn commented 1 year ago

In the current grammar, it's nontrivial to write a query that matches only, say, uses of the in operator, as

(comparison_operator "in") @comp

will match both uses of in and not in.

By adding an alias for not in and is not, these spurious matches go away.