Added more operator characters

pull/2/head
Mark 2023-08-01 09:46:53 -07:00
parent 5d234b9ff6
commit f7153f6589
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 6 additions and 2 deletions

View File

@ -123,7 +123,9 @@ pub fn tokenize(input: &String) -> VecDeque<Token> {
} }
}, },
// 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); push_token(&mut g, t, i);
t = Some(Token::Operator( t = Some(Token::Operator(
@ -136,7 +138,9 @@ pub fn tokenize(input: &String) -> VecDeque<Token> {
// Operator // Operator
'*'|'×'|'/'|'÷'| '*'|'×'|'/'|'÷'|
'^'|'!'|'%'|'=' '^'|'!'|'%'|'='|
'>'|'<'|'?'|'@'|
'&'|'|'|'~'|'\\'
=> { => {
match &mut t { match &mut t {
Some(Token::Operator(_, val)) => { val.push(c); }, Some(Token::Operator(_, val)) => { val.push(c); },