From 820cb3ba482c6af2324421cc0879910ab8b10edc Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 30 Oct 2025 22:40:29 +0000 Subject: [PATCH] update to new version of mon --- Cargo.toml | 2 +- src/atom/parsers.rs | 12 ++++++------ src/ebuild/parsers.rs | 20 ++++++++++---------- src/ebuild/repo/mod.rs | 10 +++++----- src/useflag/parsers.rs | 2 +- tests/depend.rs | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b09ede1..f20260d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2024" [dependencies] -mon = { git = "https://jturnerusa.dev/cgit/mon/", rev = "1a4d671f51cc062f506a0cc9fa2563503eb93880" } +mon = { git = "https://jturnerusa.dev/cgit/mon/", rev = "821f132bd5c8678327c2ab8764bd7d172a7b7ee4" } get = { git = "https://jturnerusa.dev/cgit/get/", rev = "cd5f75b65777a855ab010c3137304ac05f2e56b8" } itertools = "0.14.0" thiserror = "2.0.17" diff --git a/src/atom/parsers.rs b/src/atom/parsers.rs index 35df5f8..c2f812f 100644 --- a/src/atom/parsers.rs +++ b/src/atom/parsers.rs @@ -74,8 +74,8 @@ impl<'a> Parseable<'a, &'a str> for Version { type Parser = impl Parser<&'a str, Output = Self>; fn parser() -> Self::Parser { - let numbers = VersionNumber::parser().separated_list(tag("."), 1..); - let suffixes = VersionSuffix::parser().separated_list(tag("_"), 0..); + let numbers = VersionNumber::parser().separated_by(tag("."), 1..); + let suffixes = VersionSuffix::parser().separated_by(tag("_"), 0..); let rev = VersionNumber::parser().preceded_by(tag("-r")); numbers @@ -96,7 +96,7 @@ impl<'a> Parseable<'a, &'a str> for Category { fn parser() -> Self::Parser { let start = r#if(|c: &char| c.is_ascii_alphanumeric() || *c == '_'); - let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).list(0..); + let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).repeated(0..); start .and(rest) @@ -116,7 +116,7 @@ impl<'a> Parseable<'a, &'a str> for Name { r#if(|c: &char| c.is_ascii_alphanumeric() || "_+-".contains(*c)).not(), )), ) - .list(0..); + .repeated(0..); start .and(rest) @@ -140,7 +140,7 @@ impl<'a> Parseable<'a, &'a str> for SlotName { fn parser() -> Self::Parser { let start = r#if(|c: &char| c.is_ascii_alphanumeric() || *c == '_'); - let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).list(0..); + let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).repeated(0..); start .and(rest) @@ -257,7 +257,7 @@ impl<'a> Parseable<'a, &'a str> for Atom { .and(Slot::parser().preceded_by(tag(":")).opt()) .and( UseDep::parser() - .separated_list(tag(","), 0..) + .separated_by(tag(","), 0..) .delimited_by(tag("["), tag("]")) .opt(), ) diff --git a/src/ebuild/parsers.rs b/src/ebuild/parsers.rs index ef713d2..56b86ba 100644 --- a/src/ebuild/parsers.rs +++ b/src/ebuild/parsers.rs @@ -26,7 +26,7 @@ impl<'a> Parseable<'a, &'a str> for Uri { .followed_by(tag("://")) .map(|output: &str| output.to_string()); let path = r#if(|c: &char| !c.is_ascii_whitespace()) - .list(1..) + .repeated(1..) .recognize() .map(|output: &str| output.to_string()); @@ -42,7 +42,7 @@ impl<'a> Parseable<'a, &'a str> for SrcUri { fn parser() -> Self::Parser { let filename = || { r#if(|c: &char| !c.is_ascii_whitespace()) - .list(1..) + .repeated(1..) .recognize() .map(|output: &str| PathBuf::from(output)) }; @@ -65,7 +65,7 @@ impl<'a> Parseable<'a, &'a str> for License { fn parser() -> Self::Parser { let start = r#if(|c: &char| c.is_ascii_alphanumeric() || "_".contains(*c)); - let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).list(0..); + let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).repeated(0..); start .and(rest) @@ -79,7 +79,7 @@ impl<'a> Parseable<'a, &'a str> for Eapi { fn parser() -> Self::Parser { let start = r#if(|c: &char| c.is_ascii_alphanumeric() || "_".contains(*c)); - let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).list(0..); + let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_.-".contains(*c)).repeated(0..); start .and(rest) @@ -96,7 +96,7 @@ impl<'a> Parseable<'a, &'a str> for Eclass { fn parser() -> Self::Parser { r#if(|c: &char| !c.is_ascii_whitespace()) - .list(1..) + .repeated(1..) .recognize() .map(|output: &str| Eclass(output.to_string())) } @@ -111,18 +111,18 @@ where fn parser() -> Self::Parser { |it| { let all_of_group = Depend::parser() - .separated_list(whitespace1(), 1..) + .separated_by(whitespace1(), 1..) .delimited_by(tag("(").followed_by(whitespace1()), tag(")")) .map(|exprs| Depend::AllOf(exprs)); let any_of_group = Depend::parser() - .separated_list(whitespace1(), 1..) + .separated_by(whitespace1(), 1..) .delimited_by(tag("(").followed_by(whitespace1()), tag(")")) .preceded_by(tag("||").followed_by(whitespace1())) .map(|exprs| Depend::AnyOf(exprs)); let one_of_group = Depend::parser() - .separated_list(whitespace1(), 1..) + .separated_by(whitespace1(), 1..) .delimited_by(tag("(").followed_by(whitespace1()), tag(")")) .preceded_by(tag("^^").followed_by(whitespace1())) .map(|exprs| Depend::OneOf(exprs)); @@ -131,7 +131,7 @@ where .followed_by(whitespace1()) .and( Depend::parser() - .separated_list(whitespace1(), 1..) + .separated_by(whitespace1(), 1..) .delimited_by(tag("(").followed_by(whitespace1()), tag(")")), ) .map(|(conditional, exprs)| Depend::ConditionalGroup(conditional, exprs)); @@ -189,7 +189,7 @@ mod test { let it = InputIter::new("flag? ( || ( foo/bar foo/bar ) )"); Depend::::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .check_finished(it) .unwrap(); } diff --git a/src/ebuild/repo/mod.rs b/src/ebuild/repo/mod.rs index 0b1f23c..46d43ac 100644 --- a/src/ebuild/repo/mod.rs +++ b/src/ebuild/repo/mod.rs @@ -200,7 +200,7 @@ fn read_src_uri(input: &str) -> Option>, Error>> { .find_map(|line| line.strip_prefix("SRC_URI="))?; match Depend::::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .parse_finished(InputIter::new(line)) { Ok(slot) => Some(Ok(slot)), @@ -223,7 +223,7 @@ fn read_inherit(input: &str) -> Option, Error>> { .find_map(|line| line.strip_prefix("INHERIT="))?; match Eclass::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .parse_finished(InputIter::new(line)) { Ok(inherit) => Some(Ok(inherit)), @@ -235,7 +235,7 @@ fn read_iuse(input: &str) -> Option, Error>> { let line = input.lines().find_map(|line| line.strip_prefix("IUSE="))?; match IUseFlag::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .parse_finished(InputIter::new(line)) { Ok(iuse) => Some(Ok(iuse)), @@ -249,7 +249,7 @@ fn read_license(input: &str) -> Option>, Error>> { .find_map(|line| line.strip_suffix("LICENSE="))?; match Depend::::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .parse_finished(InputIter::new(line)) { Ok(license) => Some(Ok(license)), @@ -297,7 +297,7 @@ fn read_idepend(input: &str) -> Option>, Error>> { fn parse_depends(line: &str) -> Result>, Error> { Depend::::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .parse_finished(InputIter::new(line)) .map_err(|_| Error::Parser(line.to_string())) } diff --git a/src/useflag/parsers.rs b/src/useflag/parsers.rs index 6b13a64..530dfb5 100644 --- a/src/useflag/parsers.rs +++ b/src/useflag/parsers.rs @@ -10,7 +10,7 @@ impl<'a> Parseable<'a, &'a str> for UseFlag { fn parser() -> Self::Parser { let start = r#if(|c: &char| c.is_ascii_alphanumeric()); - let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_@-".contains(*c)).list(0..); + let rest = r#if(|c: &char| c.is_ascii_alphanumeric() || "+_@-".contains(*c)).repeated(0..); start .and(rest) diff --git a/tests/depend.rs b/tests/depend.rs index 3738854..c8add5d 100644 --- a/tests/depend.rs +++ b/tests/depend.rs @@ -15,7 +15,7 @@ fn parse_md5_cache() { eprintln!("{line}"); eprintln!(); Depend::::parser() - .separated_list(whitespace1(), 0..) + .separated_by(whitespace1(), 0..) .ignore() .or(eof()) .preceded_by(tag("DEPEND="))