diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-10-29 12:47:46 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-10-29 12:47:46 +0000 |
| commit | bdd1188409947bb92910cbd5b1b7039ed805273a (patch) | |
| tree | 6904467f92a901216e7d594888586ba43b84a746 /src | |
| parent | f12867ea9f3354e5d7019f5c609faf2e5a922dea (diff) | |
| download | gentoo-utils-bdd1188409947bb92910cbd5b1b7039ed805273a.tar.gz | |
fix conditional group parser
Diffstat (limited to 'src')
| -rw-r--r-- | src/depend/parsers.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/depend/parsers.rs b/src/depend/parsers.rs index 26139ea..a17c387 100644 --- a/src/depend/parsers.rs +++ b/src/depend/parsers.rs @@ -29,11 +29,14 @@ impl<'a> Parseable<'a, &'a str> for Expr { .preceded_by(tag("^^").followed_by(whitespace1())) .map(|exprs| Expr::OneOf(exprs)); - let conditional_group = Expr::parser() - .separated_list(whitespace1(), 1..) - .delimited_by(tag("(").followed_by(whitespace1()), tag(")")) - .preceded_by(Conditional::parser().followed_by(whitespace1())) - .map(|exprs| Expr::OneOf(exprs)); + let conditional_group = Conditional::parser() + .followed_by(whitespace1()) + .and( + Expr::parser() + .separated_list(whitespace1(), 1..) + .delimited_by(tag("(").followed_by(whitespace1()), tag(")")), + ) + .map(|(conditional, exprs)| Expr::ConditionalGroup(conditional, exprs)); Atom::parser() .map(|atom| Expr::Atom(atom)) |
