From c564d0f24c660134831a46705f6e1caf04fc4a24 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Wed, 23 Oct 2024 10:51:43 +0200 Subject: [PATCH] implement `Marker::abandon` --- crates/pawarser/src/parser/marker.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/pawarser/src/parser/marker.rs b/crates/pawarser/src/parser/marker.rs index d03e358..2e1244d 100644 --- a/crates/pawarser/src/parser/marker.rs +++ b/crates/pawarser/src/parser/marker.rs @@ -59,6 +59,18 @@ impl Marker { mut self, p: &mut Parser, ) { + 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!(), + } + } } }