From 82b577568c026657d09c006f73d54d7a6daaac58 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 7 Apr 2023 09:37:39 -0700 Subject: [PATCH] Fixed unary + at start --- src/parser/groupify.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/groupify.rs b/src/parser/groupify.rs index 5ea5e47..75bb337 100644 --- a/src/parser/groupify.rs +++ b/src/parser/groupify.rs @@ -22,7 +22,9 @@ fn lookback_signs( => { if o == "-" { g.insert(i, PreToken::PreOperator(*l, String::from("neg"))); - } else if o != "+" { g.insert(i, a); } + } else if o == "+" { + continue; // We should not increment i if we remove a token + } else {g.insert(i, a);} }, _ => { g.insert(i, a); } };