diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index d9f6b01..66faaee 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -91,6 +91,11 @@ fn lexer(input: &str) -> Result<Vec<Token>, String> { | |||
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |
94 | let parse_num = num_vec.parse::<f64>().ok(); | ||
95 | if let Some(x) = parse_num { | ||
96 | result.push(Token::Num(x)); | ||
97 | num_vec.clear(); | ||
98 | } | ||
94 | Ok(result) | 99 | Ok(result) |
95 | } | 100 | } |
96 | 101 | ||