From 30ba3e22c19a6be362925bb907d965b3564cf799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 2 Nov 2019 04:06:06 +0100 Subject: [PATCH] Fix precedence between predicates and comparisons --- src/parse.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parse.rs b/src/parse.rs index 20e5499..0cc40c4 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -483,9 +483,9 @@ fn formula_precedence_0(i: &str) -> IResult<&str, crate::Formula> { alt (( + comparison, predicate, boolean, - comparison, formula_parenthesized ))(i) } @@ -845,6 +845,13 @@ mod tests Box::new(crate::Term::Integer(9)), ), )))); + + assert_eq!(crate::formula("n = 5"), Ok(("", + crate::Formula::Equal + ( + crate::Term::Symbolic("n".to_string()), + crate::Term::Integer(5), + )))); } #[test]