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()))
|
.preceded_by(tag("^^").followed_by(whitespace1()))
|
||||||
.map(|exprs| Expr::OneOf(exprs));
|
.map(|exprs| Expr::OneOf(exprs));
|
||||||
|
|
||||||
let conditional_group = Expr::parser()
|
let conditional_group = Conditional::parser()
|
||||||
|
.followed_by(whitespace1())
|
||||||
|
.and(
|
||||||
|
Expr::parser()
|
||||||
.separated_list(whitespace1(), 1..)
|
.separated_list(whitespace1(), 1..)
|
||||||
.delimited_by(tag("(").followed_by(whitespace1()), tag(")"))
|
.delimited_by(tag("(").followed_by(whitespace1()), tag(")")),
|
||||||
.preceded_by(Conditional::parser().followed_by(whitespace1()))
|
)
|
||||||
.map(|exprs| Expr::OneOf(exprs));
|
.map(|(conditional, exprs)| Expr::ConditionalGroup(conditional, exprs));
|
||||||
|
|
||||||
Atom::parser()
|
Atom::parser()
|
||||||
.map(|atom| Expr::Atom(atom))
|
.map(|atom| Expr::Atom(atom))
|
||||||
|
|||||||
Reference in New Issue
Block a user