lieval 0.2.5

A lightweight Rust crate for parsing and evaluating mathematical expressions from strings.
Documentation
1
2
3
4
5
6
7
8
pub(crate) fn is_literalchar(c: char) -> bool {
    c.is_ascii_alphanumeric() || c == '_' || c == '.'
}

pub(crate) fn is_identstr(s: &str) -> bool {
    s.chars().all(|c| c.is_ascii_alphanumeric() || c == '_')
    && s.chars().find(|c| c.is_ascii_alphanumeric()).filter(|c| c.is_ascii_alphabetic()).is_some()
}