exprs

Crates.ioexprs
lib.rsexprs
version0.1.1
sourcesrc
created_at2022-11-22 13:54:26.571159
updated_at2022-11-22 13:59:13.574459
descriptionA 0 dependency math expression parser and evaluator in Rust. It aims to be simple to use and is more of an exercise than anything.
homepage
repositoryhttps://github.com/chloe0x0/exprs
max_upload_size
id720827
size18,457
(chloe0x0)

documentation

README

exprs

A 0 dependency math expression parser and evaluator in Rust. It aims to be simple to use and is more of an exercise than anything.

Quick Start

Parsing an expression is simple

use exprs::*;

fn main() {
    let expr = Expr::new("1 + 2");
 
    let computation = expr.eval();

    assert_eq!(computation, 3.0);
}

Installation

Simply add the current version to your Cargo.toml dependency list

[dependencies]
exprs = "0.1"

in your crate root add

extern crate exprs;

TODO

  • More robust parse errors rather than assert macros
Commit count: 34

cargo fmt