#expr #language #expr-parser #expr-context

expr-lang

Implementation of expr language in Rust

7 releases

new 0.1.6 Nov 25, 2024
0.1.5 Nov 25, 2024

#2512 in Parser implementations

Download history 817/week @ 2024-11-19

831 downloads per month
Used in mise

MIT license

52KB
1K SLoC

expr-lang

Implementation of expr in rust.

Usage

use expr::ExprParser;

fn main() {
    let p = ExprParser::default();
    assert_eq!(p.eval("1 + 2").unwrap().to_string(), "3");
}

lib.rs:

Implementation of expr in rust

Example:

use std::collections::HashMap;
use expr::{ExprContext, ExprParser};
let p = ExprParser::new();
let ctx = ExprContext::default();
assert_eq!(p.eval("1 + 2", &ctx).unwrap().to_string(), "3");

Dependencies

~4–7MB
~113K SLoC