diff options
Diffstat (limited to 'src/lex')
-rw-r--r-- | src/lex/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lex/mod.rs b/src/lex/mod.rs index fe9c421..b21bafb 100644 --- a/src/lex/mod.rs +++ b/src/lex/mod.rs | |||
@@ -131,7 +131,7 @@ pub fn lexer(input: &str, prev_ans: Option<f64>) -> Result<Vec<Token>, CalcError | |||
131 | 131 | ||
132 | for letter in input.chars() { | 132 | for letter in input.chars() { |
133 | match letter { | 133 | match letter { |
134 | '0'...'9' | '.' => { | 134 | '0'..='9' | '.' => { |
135 | if !char_vec.is_empty() { | 135 | if !char_vec.is_empty() { |
136 | if FUNCTIONS.get(&char_vec[..]).is_some() { | 136 | if FUNCTIONS.get(&char_vec[..]).is_some() { |
137 | return Err(CalcError::Syntax(format!( | 137 | return Err(CalcError::Syntax(format!( |
@@ -174,7 +174,7 @@ pub fn lexer(input: &str, prev_ans: Option<f64>) -> Result<Vec<Token>, CalcError | |||
174 | last_char_is_op = false; | 174 | last_char_is_op = false; |
175 | result.push(Token::Num(prev_ans.unwrap())); | 175 | result.push(Token::Num(prev_ans.unwrap())); |
176 | } | 176 | } |
177 | 'a'...'z' | 'A'...'Z' => { | 177 | 'a'..='z' | 'A'..='Z' => { |
178 | let parse_num = num_vec.parse::<f64>().ok(); | 178 | let parse_num = num_vec.parse::<f64>().ok(); |
179 | if let Some(x) = parse_num { | 179 | if let Some(x) = parse_num { |
180 | result.push(Token::Num(x)); | 180 | result.push(Token::Num(x)); |