Type issue with returning the elements.
This commit is contained in:
parent
2a595e2b6c
commit
a88117f731
@ -27,6 +27,11 @@ impl<'r> ContextTree<'r> {
|
||||
ContextTree { tree: new_list }
|
||||
}
|
||||
|
||||
pub fn pop_front(&mut self) -> (Option<ContextElement<'r>>, ContextTree<'r>) {
|
||||
// todo
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn check_fail_matcher<'s>(
|
||||
&'r self,
|
||||
i: &'s str,
|
||||
|
@ -63,10 +63,23 @@ where
|
||||
Ok((remaining, finish)) => {
|
||||
let mut ret = Vec::new();
|
||||
while !current_context.ptr_eq(context) {
|
||||
// todo
|
||||
todo!()
|
||||
let (context_element, next_context) = current_context.pop_front();
|
||||
let context_element = context_element.expect("We only pop off context elements created in this function, so they are all Some()");
|
||||
current_context = next_context;
|
||||
match context_element {
|
||||
ContextElement::FailMatcherNode(_) => {}
|
||||
ContextElement::PreviousElementNode(PreviousElementNode {
|
||||
element: token,
|
||||
}) => {
|
||||
match token {
|
||||
Token::TextElement(text_element) => {
|
||||
ret.push(text_element);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
// while current_context.tr
|
||||
// TODO build a vec of the elements by popping off the newest elements of the context
|
||||
return Ok((remaining, (ret, finish)));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user