Reverse the element order.

This commit is contained in:
Tom Alexander 2022-12-10 23:57:39 -05:00
parent 0aa8926d6b
commit fa1d845b76
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 10 additions and 11 deletions

View File

@ -75,7 +75,7 @@ where
} }
}; };
} }
// TODO build a vec of the elements by popping off the newest elements of the context ret.reverse();
return Ok((remaining, (ret, finish))); return Ok((remaining, (ret, finish)));
} }
Err(nom::Err::Error(_)) => { Err(nom::Err::Error(_)) => {
@ -132,16 +132,15 @@ pub fn paragraph<'s, 'r>(
context.with_additional_node(ContextElement::FailMatcherNode(FailMatcherNode { context.with_additional_node(ContextElement::FailMatcherNode(FailMatcherNode {
fail_matcher: ChainBehavior::AndParent(Some(&paragraph_end)), fail_matcher: ChainBehavior::AndParent(Some(&paragraph_end)),
})); }));
let ret = context_many_till(&paragraph_context, flat_text_element, context_paragraph_end)(i); let (remaining, (many, till)) =
match ret { context_many_till(&paragraph_context, flat_text_element, context_paragraph_end)(i)?;
Ok(_) => todo!(), let many = many
Err(e) => { .into_iter()
return Err(e); .filter_map(|token| match token {
} Token::TextElement(text_element) => Some(text_element),
}; })
// TODO: FIX THIS .collect();
// ret Ok((remaining, (many, till)))
todo!()
} }
fn flat_text_element<'s, 'r>( fn flat_text_element<'s, 'r>(