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)));
}
Err(nom::Err::Error(_)) => {
@ -132,16 +132,15 @@ pub fn paragraph<'s, 'r>(
context.with_additional_node(ContextElement::FailMatcherNode(FailMatcherNode {
fail_matcher: ChainBehavior::AndParent(Some(&paragraph_end)),
}));
let ret = context_many_till(&paragraph_context, flat_text_element, context_paragraph_end)(i);
match ret {
Ok(_) => todo!(),
Err(e) => {
return Err(e);
}
};
// TODO: FIX THIS
// ret
todo!()
let (remaining, (many, till)) =
context_many_till(&paragraph_context, flat_text_element, context_paragraph_end)(i)?;
let many = many
.into_iter()
.filter_map(|token| match token {
Token::TextElement(text_element) => Some(text_element),
})
.collect();
Ok((remaining, (many, till)))
}
fn flat_text_element<'s, 'r>(