implement Marker::abandon

This commit is contained in:
Schrottkatze 2024-10-23 10:51:43 +02:00
parent b8720b2df9
commit c564d0f24c
No known key found for this signature in database

View file

@ -59,6 +59,18 @@ impl Marker {
mut self,
p: &mut Parser<SyntaxKind, SyntaxErr>,
) {
self.bomb.defuse();
// clean up empty tombstone event from marker
if self.pos == p.events.len() - 1 {
match p.events.pop() {
Some(Event::Start {
kind: NodeKind::Tombstone,
forward_parent: None,
}) => (),
_ => unreachable!(),
}
}
}
}