refactor: Migrate from Parser to ModalParser

This commit is contained in:
Ed Page 2025-01-30 15:02:50 -06:00
parent 7830eb8730
commit 4c22f194b5

View file

@ -538,10 +538,10 @@ mod parser {
trace("printf", ('%', take_while(1.., is_xid_continue)).take()).parse_next(input) trace("printf", ('%', take_while(1.., is_xid_continue)).take()).parse_next(input)
} }
fn take_many0<I, E, F>(mut f: F) -> impl Parser<I, <I as Stream>::Slice, E> fn take_many0<I, E, F>(mut f: F) -> impl ModalParser<I, <I as Stream>::Slice, E>
where where
I: Stream, I: Stream,
F: Parser<I, <I as Stream>::Slice, E>, F: ModalParser<I, <I as Stream>::Slice, E>,
E: ParserError<I>, E: ParserError<I>,
{ {
move |i: &mut I| repeat(0.., f.by_ref()).map(|()| ()).take().parse_next(i) move |i: &mut I| repeat(0.., f.by_ref()).map(|()| ()).take().parse_next(i)