Closed seblj closed 9 months ago
we can't tell if the end tag is intended to be the end of a tag that exists above it, or is a mistake/typo for the opening tag immediately before it - this doesn't have a practical solution and can't be solved, this is difficult even when you're being context-aware (which tree-sitter isn't)
I am trying to parse the tree at an "invalid" state where one tag has a different name than the other tag, and I noticed something that I believe could be a bug.
This code:
Produces this tree:
However, I would expect it to produce this:
Notice that
erronous_end_tag
anderronous_end_tag_name
is not a child ofelement
. However, if the tags have the same name, then they are a child of element (only withend_tag
andend_tag_name
. It is perfectly fine to mark it as erronous_end_tag-nodes, but I believe they should still be a part of the element node?I tried to look at this myself, but I am not too familiar with tree-sitter parsers, so I couldn't find out how to solve this yet. Would appreciate any help if someone does not want to fix this themselves :)