Skip to content

Commit b954b22

Browse files
committed
switch to chumsky, ignore units for now
1 parent 70e2df0 commit b954b22

7 files changed

Lines changed: 264 additions & 184 deletions

File tree

Cargo.lock

Lines changed: 66 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libraries/math-parser/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ description = "Parser for Graphite style mathematics expressions"
88
license = "MIT OR Apache-2.0"
99

1010
[dependencies]
11-
pest = "2.7"
12-
pest_derive = "2.7.11"
1311
thiserror = "2.0"
1412
lazy_static = "1.5"
1513
num-complex = "0.4"
1614
log = { workspace = true }
15+
chumsky = "0.10"
1716

1817
[dev-dependencies]
1918
criterion = "0.5"

libraries/math-parser/src/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ pub enum BinaryOp {
5757
Div,
5858
Pow,
5959
Leq,
60+
Lt,
6061
Geq,
62+
Gt,
6163
Eq,
6264
}
6365

libraries/math-parser/src/constants.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use std::{
66
use crate::value::{Number, Value};
77
use lazy_static::lazy_static;
88
use num_complex::{Complex, ComplexFloat};
9-
use std::collections::HashMap;
10-
use std::f64::consts::PI;
119

1210
type FunctionImplementation = Box<dyn Fn(&[Value]) -> Option<Value> + Send + Sync>;
1311
lazy_static! {

0 commit comments

Comments
 (0)