Skip to content

Verify finish_if handling of multiple spans ending at same position #81

@coderabbitai

Description

@coderabbitai

Issue Description

finish_if may call finish_node multiple times for the same position.

Verify that handling multiple spans ending at the same position does not cause panics or corrupt the tree structure.

Location

src/parser/cst_builder/tree.rs:38

Code Context

    fn finish_if(&mut self, builder: &mut GreenNodeBuilder, pos: usize) {
        if matches!(self.iter.peek(), Some(s) if pos >= s.end) {
            builder.finish_node();

References

Metadata

Metadata

Assignees

Labels

mediumMedium criticality issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions