From d1ab9a2848e7d4db490e505287214442f699bc1d Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 11 Sep 2020 22:09:09 +0800 Subject: [PATCH] Fix bug on unary function hashes. --- src/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index a3232247..d598c7a6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1838,7 +1838,7 @@ fn parse_unary( // Call negative function expr => { let op = "-"; - let hash = calc_fn_hash(empty(), op, 2, empty()); + let hash = calc_fn_hash(empty(), op, 1, empty()); let mut args = StaticVec::new(); args.push(expr); @@ -1865,7 +1865,7 @@ fn parse_unary( args.push(expr); let op = "!"; - let hash = calc_fn_hash(empty(), op, 2, empty()); + let hash = calc_fn_hash(empty(), op, 1, empty()); Ok(Expr::FnCall(Box::new(( (op.into(), true, false, pos),