LineComments get incorrectly nested following an IfStatement #51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Consider this code:
This get parsed as (this is a custom printing format which uses a prefix of 2 spaces to print nested child nodes, if there is a preferred format, please comment and I can update it):
For comparison, this is how tree-sitter parses it:
The comments are within
bodybut outside theif_statement.I also noticed that this only happens if there are two or more lines of comments. If there is a single comment line, then it gets parsed correctly:
This isn't what I'm seeing (the comment nodes are outside the
IfStatementnode when I run this). Could it be that you're using an old @lezer/lr package?Oh, actually, it seems I was testing with patch
github.com/lezer-parser/lr@3eaa5d3751, but that hadn't been released yet. Try with @lezer/lr 1.4.3The patch fixed it. Thanks.