From 2a181e5aab956fcb76e0a6eb9f6f21cc0eaa81ee Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 13 Mar 2020 16:54:00 +0800 Subject: [PATCH] FIX - fix minus/negative number conflict. --- src/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 66eec95f..a02baf0f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -891,7 +891,8 @@ impl<'a> TokenIterator<'a> { } '-' => match self.char_stream.peek() { // Negative number? - Some('0'..='9') => negated = true, + Some('0'..='9') if self.last.is_next_unary() => negated = true, + Some('0'..='9') => return Some((Token::Minus, pos)), Some('=') => { self.char_stream.next(); self.advance();