From bdd1188409947bb92910cbd5b1b7039ed805273a Mon Sep 17 00:00:00 2001 From: John Turner Date: Wed, 29 Oct 2025 12:47:46 +0000 Subject: [PATCH] fix conditional group parser --- src/depend/parsers.rs | 13 ++++++++----- 1 file 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))