Implement iterator for context.
This commit is contained in:
@@ -399,10 +399,9 @@ fn time_range_rest_end<'r, 's>(
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
// We pop off the most recent context element to get a context tree with just the active/inactive_time_rest_end exit matcher (removing this function from the exit matcher chain) because the 2nd time in the range does not end when a "-TIME" pattern is found.
|
||||
let parent_node = context.iter().next().expect("Two context elements are added to the tree when adding this exit matcher, so it should be impossible for this to return None.");
|
||||
let parent_tree = ContextTree::branch_from(parent_node);
|
||||
let parent_node = context.get_parent().expect("Two context elements are added to the tree when adding this exit matcher, so it should be impossible for this to return None.");
|
||||
let exit_contents =
|
||||
recognize(tuple((tag("-"), parser_with_context!(time)(&parent_tree))))(input);
|
||||
recognize(tuple((tag("-"), parser_with_context!(time)(&parent_node))))(input);
|
||||
exit_contents
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user