From abafb39041d47f1fe4281c60cb4e3e40db2181d1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 26 Sep 2022 16:25:40 +0200 Subject: Fix bad list interaction Fixes #87 --- src/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parse/parser.rs') diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 90b6e610..f8ea9614 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -454,8 +454,8 @@ impl Marker { /// Wrap all children after the marker (excluding trailing trivia) in a node /// with the given `kind`. pub fn end(self, p: &mut Parser, kind: NodeKind) { - let until = p.trivia_start(); - let children = p.children.drain(self.0 .. until.0).collect(); + let until = p.trivia_start().0.max(self.0); + let children = p.children.drain(self.0 .. until).collect(); p.children .insert(self.0, InnerNode::with_children(kind, children).into()); } -- cgit v1.2.3