Solved the lifetime issue by using the standard many1 combinator.

This commit is contained in:
Tom Alexander 2023-03-23 20:00:35 -04:00
parent 02d04b59db
commit 4f10f2abec
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -4,10 +4,10 @@ use nom::character::complete::line_ending;
use nom::character::complete::space1;
use nom::combinator::eof;
use nom::combinator::recognize;
use nom::multi::many1;
use nom::multi::many1_count;
use nom::sequence::tuple;
use crate::parser::combinator::context_many1;
use crate::parser::error::CustomError;
use crate::parser::error::MyError;
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 {
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((
many1_count(tag("*")),
space1,
title_matcher(standard_set_object),
many1(standard_set_object_matcher),
alt((line_ending, eof)),
))(input)?;
todo!()