tree-sitter-python icon indicating copy to clipboard operation
tree-sitter-python copied to clipboard

`not in` vs `[not, in]`

Open NorthIsUp opened this issue 3 years ago • 3 comments

Python's ast has NotIn as a node, should we also have it be a single node?

NorthIsUp avatar Mar 23 '22 20:03 NorthIsUp

Would be interesting to then also include the IsNot node!

cedricrupb avatar Mar 30 '22 13:03 cedricrupb

They are exposed as anonymous nodes now

https://github.com/tree-sitter/tree-sitter-python/blob/7c8930b6388b5590ebef248853f144185a9eda1d/grammar.js#L709-L711

ref https://github.com/tree-sitter/tree-sitter-python/pull/190

Just keep in mind that there is a bug in tree-sitter, that makes this two nodes "not int" "not in" :/ https://github.com/tree-sitter/tree-sitter/issues/2299

stsewd avatar Jul 12 '23 17:07 stsewd

"not in" is not recognized correctly in latest Emacs+tree-sitter either. Looking forward to it 🙂

shaohme avatar Nov 02 '23 12:11 shaohme