Closed Lapz closed 5 years ago
You probably want checkpoint method: https://github.com/rust-analyzer/rowan/blob/a00ccb60ea99eccbc7f24d31ee83e925e0d8258d/src/green.rs#L185
In rust-analyzer, we handle this by in another way, by a filtering pre-pass that turns expr, expr, tuple
events into tuple, expr, expr
Thanks.
It would be really useful if there was a way to change the root syntax kind for a node. The reason for this is because the language that I'm using has both grouping expressions i.e.
(1+10)
and tuple expressions. So when parsing a grouping expression which is actually a tuple expression it would be nice if theGreenNodeBuilder
offered an API that could swap the current root node to something else.