FIX - fix minus/negative number conflict.

This commit is contained in:
Stephen Chung 2020-03-13 16:54:00 +08:00
parent 9bd66c7db3
commit 2a181e5aab

View File

@ -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();