tree-sitter / tree-sitter-python

Python grammar for tree-sitter
MIT License
374 stars 138 forks source link

Put match inner block in a `block` node #226

Closed stsewd closed 1 year ago

stsewd commented 1 year ago

This matches the other block statements (with, try, if, etc), all of them have a body field with a block node that contains the body of the statement.

https://github.com/tree-sitter/tree-sitter-python/blob/5a5455ef88ead370a9c7b93d8f55ea5a6b9127d7/grammar.js#L487-L496

This was also allowing

match 1: case 1: pass

Which is invalid, match blocks need an indentation

amaanq commented 1 year ago

Awesome