From b27f911ff3879fe7ae599696169d09c827adebc6 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 14 Jul 2023 20:24:06 -0400 Subject: [PATCH] Finish implementing token iteration. --- src/parser/token.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/parser/token.rs b/src/parser/token.rs index dbfbdda..5dc7e20 100644 --- a/src/parser/token.rs +++ b/src/parser/token.rs @@ -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)),