forked from gentoo-utils/gentoo-utils
fix conditional group parser
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user