Finish implementing token iteration.

This commit is contained in:
Tom Alexander 2023-07-14 20:24:06 -04:00
parent 08e6efe5f5
commit b27f911ff3
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -37,19 +37,19 @@ impl<'r, 's> Token<'r, 's> {
)),
Token::Section(section) => Box::new(section.children.iter().map(Token::Element)),
Token::Object(obj) => match obj {
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!(),
Object::Bold(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::Italic(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::Underline(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::StrikeThrough(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::Code(_) => Box::new(std::iter::empty()),
Object::Verbatim(_) => Box::new(std::iter::empty()),
Object::PlainText(_) => Box::new(std::iter::empty()),
Object::RegularLink(_) => Box::new(std::iter::empty()),
Object::RadioLink(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::RadioTarget(inner) => Box::new(inner.children.iter().map(Token::Object)),
Object::PlainLink(_) => Box::new(std::iter::empty()),
Object::AngleLink(_) => Box::new(std::iter::empty()),
Object::OrgMacro(_) => Box::new(std::iter::empty()),
},
Token::Element(elem) => match elem {
Element::Paragraph(inner) => Box::new(inner.children.iter().map(Token::Object)),