Fix negation parser

This commit is contained in:
2020-04-09 16:07:29 +02:00
parent 3414e8075c
commit 95677bae34
+9 -5
View File
@@ -52,14 +52,18 @@ pub fn predicate<'i>(i: &'i str, d: &Declarations) -> IResult<&'i str, crate::Pr
fn not<'a>(i: &'a str, d: &Declarations) -> IResult<&'a str, crate::Formula> fn not<'a>(i: &'a str, d: &Declarations) -> IResult<&'a str, crate::Formula>
{ {
preceded map
( (
terminated preceded
( (
tag("not"), terminated
multispace0, (
tag("not"),
multispace0,
),
|i| formula_precedence_2(i, d),
), ),
|i| formula_precedence_2(i, d), |x| crate::Formula::not(Box::new(x)),
)(i) )(i)
} }