fixup! inline: impl container attributes
This commit is contained in:
parent
666e9cfd40
commit
a1bcc4277d
1 changed files with 20 additions and 8 deletions
|
@ -271,15 +271,15 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
|
||||||
};
|
};
|
||||||
self.openers.drain(o..);
|
self.openers.drain(o..);
|
||||||
let mut ahead = self.lexer.inner().clone();
|
let mut ahead = self.lexer.inner().clone();
|
||||||
let attr_len = attr::valid(&mut ahead);
|
let mut attr_len = attr::valid(&mut ahead);
|
||||||
dbg!(self.span);
|
|
||||||
dbg!(attr_len);
|
|
||||||
if attr_len > 0 {
|
if attr_len > 0 {
|
||||||
self.lexer = lex::Lexer::new(ahead);
|
self.events[e_attr].span = Span::empty_at(self.span.end());
|
||||||
let span = Span::by_len(self.span.end(), attr_len);
|
self.events[e_attr].kind = EventKind::Attributes;
|
||||||
self.events[e_attr] = Event {
|
while attr_len > 0 {
|
||||||
kind: EventKind::Attributes,
|
self.lexer = lex::Lexer::new(ahead.clone());
|
||||||
span,
|
self.span = self.events[e_attr].span.extend(attr_len);
|
||||||
|
self.events[e_attr].span = self.span;
|
||||||
|
attr_len = attr::valid(&mut ahead);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event
|
event
|
||||||
|
@ -776,4 +776,16 @@ mod test {
|
||||||
(Exit(Emphasis), "_"),
|
(Exit(Emphasis), "_"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn container_attr_multiple() {
|
||||||
|
test_parse!(
|
||||||
|
"_abc def_{.a}{.b}{.c} {.d}",
|
||||||
|
(Attributes, "{.a}{.b}{.c}"),
|
||||||
|
(Enter(Emphasis), "_"),
|
||||||
|
(Str, "abc def"),
|
||||||
|
(Exit(Emphasis), "_"),
|
||||||
|
(Str, " {.d}"),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue