From 8a58d2182ac8bf22c092699d66689e97157b1ad9 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 26 Mar 2023 10:15:15 -0700 Subject: [PATCH] Fixed another tokenize bug --- src/parser/tokenize.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser/tokenize.rs b/src/parser/tokenize.rs index 0b51df9..2f50de0 100644 --- a/src/parser/tokenize.rs +++ b/src/parser/tokenize.rs @@ -38,12 +38,12 @@ pub fn p_tokenize(input: &String) -> VecDeque { // Needs special treatment. '-' => { if t.is_some() { g.push_back(update_line_location(t.unwrap(), i)); } - match g.back().as_ref().unwrap() { + match g.back().as_ref() { // If previous token was any of the following, // this is the "minus" operator - Token::PreNumber(_, _) | - Token::PreGroup(_, _) | - Token::PreWord(_, _) => { + Some(Token::PreNumber(_, _)) | + Some(Token::PreGroup(_, _)) | + Some(Token::PreWord(_, _)) => { t = Some(Token::PreOperator( LineLocation{pos: i, len: 1}, Operator::Subtract