tinyexpr 0.1.1

Tiny recursive descent expression parser, compiler, and evaluation engine for math expressions. A work in progress port of TinyExpr library to Rust.
Documentation
  • Coverage
  • 18.92%
    7 out of 37 items documented2 out of 3 items with examples
  • Size
  • Source code size: 33.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.19 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • kondrak/tinyexpr-rs
    11 1 5
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kondrak

tinyexpr-rs

Crates.io Documentation Build Status Build status Coverage Status

Tiny recursive descent expression parser, compiler, and evaluation engine for math expressions.

This is a WIP port of TinyExpr to Rust. Current release only supports built-in system functions (trigonometry, algebraic operations, constants, etc.). See the tests module for more examples.

Documentation

Usage

# Cargo.toml
[dependencies]
tinyexpr = "0.1"

Example

extern crate tinyexpr;

fn main()
{
    // parse the expression and fetch result
    let r = tinyexpr::interp("2+2*2").unwrap();

    // should print "6"
    println!("{:?}", r);
}

Build instructions

cargo build
cargo run --example tinyexpr

Todo

  • support for custom user function
  • support for functions taking more than 2 parameters
  • support closures

License

Licensed under either of