From f7153f65894f14a4d2929510e1ea84c3345d92dc Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 1 Aug 2023 09:46:53 -0700 Subject: [PATCH] Added more operator characters --- src/parser/stage/tokenize.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/parser/stage/tokenize.rs b/src/parser/stage/tokenize.rs index 470631d..f2b4b9c 100644 --- a/src/parser/stage/tokenize.rs +++ b/src/parser/stage/tokenize.rs @@ -123,7 +123,9 @@ pub fn tokenize(input: &String) -> VecDeque { } }, - // This may be a negative or a subtraction + // This may be a negative or a subtraction. + // Multi-character operators with - and + are NOT supported! + // (for example, we can't use -> for unit conversion) _ => { push_token(&mut g, t, i); t = Some(Token::Operator( @@ -136,7 +138,9 @@ pub fn tokenize(input: &String) -> VecDeque { // Operator '*'|'×'|'/'|'÷'| - '^'|'!'|'%'|'=' + '^'|'!'|'%'|'='| + '>'|'<'|'?'|'@'| + '&'|'|'|'~'|'\\' => { match &mut t { Some(Token::Operator(_, val)) => { val.push(c); },