inline: do not merge discontinuous str

may appear when ignoring attributes
This commit is contained in:
Noah Hellman 2023-01-19 22:39:49 +01:00
parent d3b2ee14cb
commit 79dfd3be36

View file

@ -662,10 +662,9 @@ impl<I: Iterator<Item = char> + Clone> Iterator for Parser<I> {
matches!(
e.kind,
EventKind::Str | EventKind::Whitespace | EventKind::Placeholder
)
) && span.end() == e.span.start()
}) {
let ev = self.events.pop_front().unwrap();
assert_eq!(span.end(), ev.span.start());
span = span.union(ev.span);
}
Some(Event {
@ -950,6 +949,7 @@ mod test {
(Str, "abc"),
(Exit(Span), "]"),
);
test_parse!("not a [span] {#id}.", (Str, "not a [span] "), (Str, "."));
}
#[test]