Filling in more of the iter_tokens tree.
This commit is contained in:
parent
793e560bd5
commit
0e73b83bf3
@ -2,6 +2,7 @@ use super::Document;
|
|||||||
use super::Element;
|
use super::Element;
|
||||||
use super::Heading;
|
use super::Heading;
|
||||||
use super::Object;
|
use super::Object;
|
||||||
|
use super::PlainListItem;
|
||||||
use super::Section;
|
use super::Section;
|
||||||
use crate::parser::DocumentElement;
|
use crate::parser::DocumentElement;
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ pub enum Token<'r, 's> {
|
|||||||
Section(&'r Section<'s>),
|
Section(&'r Section<'s>),
|
||||||
Object(&'r Object<'s>),
|
Object(&'r Object<'s>),
|
||||||
Element(&'r Element<'s>),
|
Element(&'r Element<'s>),
|
||||||
|
PlainListItem(&'r PlainListItem<'s>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'r, 's> Token<'r, 's> {
|
impl<'r, 's> Token<'r, 's> {
|
||||||
@ -30,8 +32,47 @@ impl<'r, 's> Token<'r, 's> {
|
|||||||
}),
|
}),
|
||||||
)),
|
)),
|
||||||
Token::Section(section) => Box::new(section.children.iter().map(Token::Element)),
|
Token::Section(section) => Box::new(section.children.iter().map(Token::Element)),
|
||||||
Token::Object(_) => panic!(),
|
Token::Object(obj) => match obj {
|
||||||
Token::Element(_) => panic!(),
|
Object::Bold(_) => todo!(),
|
||||||
|
Object::Italic(_) => todo!(),
|
||||||
|
Object::Underline(_) => todo!(),
|
||||||
|
Object::StrikeThrough(_) => todo!(),
|
||||||
|
Object::Code(_) => todo!(),
|
||||||
|
Object::Verbatim(_) => todo!(),
|
||||||
|
Object::PlainText(_) => todo!(),
|
||||||
|
Object::RegularLink(_) => todo!(),
|
||||||
|
Object::RadioLink(_) => todo!(),
|
||||||
|
Object::RadioTarget(_) => todo!(),
|
||||||
|
Object::PlainLink(_) => todo!(),
|
||||||
|
Object::AngleLink(_) => todo!(),
|
||||||
|
Object::OrgMacro(_) => todo!(),
|
||||||
|
},
|
||||||
|
Token::Element(elem) => match elem {
|
||||||
|
Element::Paragraph(inner) => Box::new(inner.children.iter().map(Token::Object)),
|
||||||
|
Element::PlainList(inner) => {
|
||||||
|
Box::new(inner.children.iter().map(Token::PlainListItem))
|
||||||
|
}
|
||||||
|
Element::GreaterBlock(inner) => Box::new(inner.children.iter().map(Token::Element)),
|
||||||
|
Element::DynamicBlock(_) => todo!(),
|
||||||
|
Element::FootnoteDefinition(_) => todo!(),
|
||||||
|
Element::Comment(_) => todo!(),
|
||||||
|
Element::Drawer(_) => todo!(),
|
||||||
|
Element::PropertyDrawer(_) => todo!(),
|
||||||
|
Element::Table(_) => todo!(),
|
||||||
|
Element::VerseBlock(_) => todo!(),
|
||||||
|
Element::CommentBlock(_) => todo!(),
|
||||||
|
Element::ExampleBlock(_) => todo!(),
|
||||||
|
Element::ExportBlock(_) => todo!(),
|
||||||
|
Element::SrcBlock(_) => todo!(),
|
||||||
|
Element::Clock(_) => todo!(),
|
||||||
|
Element::DiarySexp(_) => todo!(),
|
||||||
|
Element::Planning(_) => todo!(),
|
||||||
|
Element::FixedWidthArea(_) => todo!(),
|
||||||
|
Element::HorizontalRule(_) => todo!(),
|
||||||
|
Element::Keyword(_) => todo!(),
|
||||||
|
Element::LatexEnvironment(_) => todo!(),
|
||||||
|
},
|
||||||
|
Token::PlainListItem(elem) => Box::new(elem.children.iter().map(Token::Element)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user