mirror of
https://jturnerusa.dev/cgit/gentoo-utils/
synced 2025-12-02 19:18:35 -06:00
bump mon and use SeparatedByWithTrailing combinator where needed
The new version of mon fixed the SeparatedBy combinator to not allow trailing delimiters. This broke the Depend expr parser, because the exprs are padded with whitespace. Using the new SeparatedByWithTrailing combinator fixes this issue.
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -40,7 +40,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "mon"
|
name = "mon"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://jturnerusa.dev/cgit/mon/?rev=5b7d7eec545864727d33bb59503f0349cf02b337#5b7d7eec545864727d33bb59503f0349cf02b337"
|
source = "git+https://jturnerusa.dev/cgit/mon/?rev=34d8eeb989012b0f20041b11a60ced24ca702527#34d8eeb989012b0f20041b11a60ced24ca702527"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
mon = { git = "https://jturnerusa.dev/cgit/mon/", rev = "5b7d7eec545864727d33bb59503f0349cf02b337" }
|
mon = { git = "https://jturnerusa.dev/cgit/mon/", rev = "34d8eeb989012b0f20041b11a60ced24ca702527" }
|
||||||
get = { git = "https://jturnerusa.dev/cgit/get/", rev = "cd5f75b65777a855ab010c3137304ac05f2e56b8" }
|
get = { git = "https://jturnerusa.dev/cgit/get/", rev = "cd5f75b65777a855ab010c3137304ac05f2e56b8" }
|
||||||
itertools = "0.14.0"
|
itertools = "0.14.0"
|
||||||
thiserror = "2.0.17"
|
thiserror = "2.0.17"
|
||||||
|
|||||||
@@ -114,34 +114,26 @@ where
|
|||||||
|
|
||||||
fn parser() -> Self::Parser {
|
fn parser() -> Self::Parser {
|
||||||
|it| {
|
|it| {
|
||||||
let all_of_group = Depend::parser()
|
let exprs = || {
|
||||||
.separated_by(whitespace1())
|
Depend::parser()
|
||||||
.at_least(1)
|
.separated_by_with_trailing(whitespace1())
|
||||||
.delimited_by(tag("(").followed_by(whitespace1()), tag(")"))
|
.at_least(1)
|
||||||
.map(|exprs| Depend::AllOf(exprs));
|
.delimited_by(tag("(").followed_by(whitespace1()), tag(")"))
|
||||||
|
};
|
||||||
|
|
||||||
let any_of_group = Depend::parser()
|
let all_of_group = exprs().map(|exprs| Depend::AllOf(exprs));
|
||||||
.separated_by(whitespace1())
|
|
||||||
.at_least(1)
|
let any_of_group = exprs()
|
||||||
.delimited_by(tag("(").followed_by(whitespace1()), tag(")"))
|
|
||||||
.preceded_by(tag("||").followed_by(whitespace1()))
|
.preceded_by(tag("||").followed_by(whitespace1()))
|
||||||
.map(|exprs| Depend::AnyOf(exprs));
|
.map(|exprs| Depend::AnyOf(exprs));
|
||||||
|
|
||||||
let one_of_group = Depend::parser()
|
let one_of_group = exprs()
|
||||||
.separated_by(whitespace1())
|
|
||||||
.at_least(1)
|
|
||||||
.delimited_by(tag("(").followed_by(whitespace1()), tag(")"))
|
|
||||||
.preceded_by(tag("^^").followed_by(whitespace1()))
|
.preceded_by(tag("^^").followed_by(whitespace1()))
|
||||||
.map(|exprs| Depend::OneOf(exprs));
|
.map(|exprs| Depend::OneOf(exprs));
|
||||||
|
|
||||||
let conditional_group = Conditional::parser()
|
let conditional_group = Conditional::parser()
|
||||||
.followed_by(whitespace1())
|
.followed_by(whitespace1())
|
||||||
.and(
|
.and(exprs())
|
||||||
Depend::parser()
|
|
||||||
.separated_by(whitespace1())
|
|
||||||
.at_least(1)
|
|
||||||
.delimited_by(tag("(").followed_by(whitespace1()), tag(")")),
|
|
||||||
)
|
|
||||||
.map(|(conditional, exprs)| Depend::ConditionalGroup(conditional, exprs));
|
.map(|(conditional, exprs)| Depend::ConditionalGroup(conditional, exprs));
|
||||||
|
|
||||||
T::parser()
|
T::parser()
|
||||||
|
|||||||
Reference in New Issue
Block a user