Parser tweak

master
Mark 2024-03-04 23:12:40 -08:00
parent 6f9ab43fff
commit f9f28a54d7
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
1 changed files with 2 additions and 1 deletions

View File

@ -93,7 +93,8 @@ impl TreeElement {
pub fn evaluate(&self) -> Option<f32> {
match self {
Self::Number(x) => Some(*x),
Self::Partial(_) => None,
// Try to parse strings of a partial
Self::Partial(s) => s.parse().ok(),
Self::Add { l, r } => {
let l = l.evaluate();
let r = r.evaluate();