aboutsummaryrefslogtreecommitdiff
path: root/src/lex
diff options
context:
space:
mode:
authorDominik Süß <[email protected]>2019-10-14 19:28:54 +0100
committerDominik Süß <[email protected]>2019-10-14 19:28:54 +0100
commit432129fcfe47abe83f5f20d544a4f14686921c7e (patch)
tree89bc4262f49967b6b9fe050f9f2e8e506a90c785 /src/lex
parentd74ac7e20061cc353590b9b61977ec3aae334aba (diff)
fix warnings as well as issues with the cache dir
Diffstat (limited to 'src/lex')
-rw-r--r--src/lex/mod.rs4
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));