rustorm 0.10.8

A complete rewrite of rustorm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate meval;

fn trim_parenthesis(arg: &str) -> &str {
    arg.trim_left_matches('(').trim_right_matches(')')
}

pub fn maybe_trim_parenthesis(arg: &str) -> &str {
    if arg.starts_with("(") && arg.ends_with(")") {
        trim_parenthesis(arg)
    } else {
        arg
    }
}

pub fn eval_f64(expr: &str) -> Result<f64, meval::Error> {
    meval::eval_str(expr)
}