From 95677bae347cb159efac33b76b07f5b8e72408f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Fri, 27 Mar 2020 03:20:23 +0100 Subject: [PATCH] Fix negation parser --- src/parse/formulas.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/parse/formulas.rs b/src/parse/formulas.rs index 2966ed4..51d3667 100644 --- a/src/parse/formulas.rs +++ b/src/parse/formulas.rs @@ -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> { - preceded + map ( - terminated + preceded ( - tag("not"), - multispace0, + terminated + ( + tag("not"), + multispace0, + ), + |i| formula_precedence_2(i, d), ), - |i| formula_precedence_2(i, d), + |x| crate::Formula::not(Box::new(x)), )(i) }