Solved the lifetime issue by using the standard many1 combinator.
This commit is contained in:
parent
02d04b59db
commit
4f10f2abec
@ -4,10 +4,10 @@ use nom::character::complete::line_ending;
|
|||||||
use nom::character::complete::space1;
|
use nom::character::complete::space1;
|
||||||
use nom::combinator::eof;
|
use nom::combinator::eof;
|
||||||
use nom::combinator::recognize;
|
use nom::combinator::recognize;
|
||||||
|
use nom::multi::many1;
|
||||||
use nom::multi::many1_count;
|
use nom::multi::many1_count;
|
||||||
use nom::sequence::tuple;
|
use nom::sequence::tuple;
|
||||||
|
|
||||||
use crate::parser::combinator::context_many1;
|
|
||||||
use crate::parser::error::CustomError;
|
use crate::parser::error::CustomError;
|
||||||
use crate::parser::error::MyError;
|
use crate::parser::error::MyError;
|
||||||
use crate::parser::object::standard_set_object;
|
use crate::parser::object::standard_set_object;
|
||||||
@ -110,12 +110,13 @@ fn headline<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'
|
|||||||
context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||||
exit_matcher: ChainBehavior::AndParent(Some(&headline_end)),
|
exit_matcher: ChainBehavior::AndParent(Some(&headline_end)),
|
||||||
}));
|
}));
|
||||||
let title_matcher = parser_with_context!(context_many1)(&parser_context);
|
let standard_set_object_matcher = parser_with_context!(standard_set_object)(&parser_context);
|
||||||
|
|
||||||
let foo = tuple((
|
let foo = tuple((
|
||||||
many1_count(tag("*")),
|
many1_count(tag("*")),
|
||||||
space1,
|
space1,
|
||||||
title_matcher(standard_set_object),
|
many1(standard_set_object_matcher),
|
||||||
|
alt((line_ending, eof)),
|
||||||
))(input)?;
|
))(input)?;
|
||||||
|
|
||||||
todo!()
|
todo!()
|
||||||
|
Loading…
Reference in New Issue
Block a user