Use context_many1 for paragraphs in a document.

This commit is contained in:
Tom Alexander
2022-12-16 01:35:49 -05:00
parent 601fc4776a
commit 1da38c8f7d
4 changed files with 38 additions and 11 deletions

View File

@@ -1,8 +1,10 @@
use super::text::Paragraph;
use super::text::TextElement;
#[derive(Debug)]
pub enum Token<'a> {
TextElement(TextElement<'a>),
Paragraph(Paragraph<'a>),
}
impl<'a> Into<Token<'a>> for TextElement<'a> {
@@ -10,3 +12,9 @@ impl<'a> Into<Token<'a>> for TextElement<'a> {
Token::TextElement(self)
}
}
impl<'a> Into<Token<'a>> for Paragraph<'a> {
fn into(self) -> Token<'a> {
Token::Paragraph(self)
}
}