mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-12-01 07:24:56 -10:00
* Add matrices to the math expression parser as a second sort beside values * Add Transform input and output to the Math f(x) node * Add ranges and boxes to the math expression parser with inside, clamp, and remap over them * Add Transform lists to the Math f(…) node with reducers composing, averaging, and counting them * Lex a number's trailing e as Euler's number unless an exponent's digits follow it * Fix matrix inversion scaling, exact matrix powers, infinite shears, matrix means, kept axes, and the Transform default * Make shared box parts flat, give composed regions their inner map's axes, and fix lone logic items, spaced ranges, and the Math f(…) tooltip * Transpose across spaces, name fractional matrix powers, check matrix builtin arities when parsing, read range literals by their corners, and let host functions shadow matrix builtins * Make inside and clamp hold a region's uncovered parts at zero, so a box contains only the points between its corners * Require hosts to declare the functions they provide, name the region functions' syntax node after its builtin, and remap onto ranges with equal infinite corners * Apply a matrix to the whole product after it, so M 2 v is M (2 v) * Pin prefix NOT's precedence above products, comparisons, and AND with tests * Rename inside to within, since a range's ends count and the geometry predicates with a point first use that name * Keep a range's corners as written, so clamp orders an integer past the reals' limit exactly * Give within a tolerance of a billionth of the region's scale, so a point a float error off an edge or a flat side counts * Write a unit part as its basis alone, so the identity displays as [1;i;j;k] * Add tests for product folds, mixed chains, remap, and rejected inputs * Evaluate matrix operands, builder arguments, regions, and comparison chains on the stack instead of the heap * Build the expression parsers once per thread, since building the combinator tree cost as much as parsing a short expression * Compare a chain reducer's items by their order directly, and reject an item with no order rather than reading it as false * Send a host-built list of builder arguments or regions past the stack buffers to the heap instead of rejecting it
29 lines
616 B
TOML
29 lines
616 B
TOML
[package]
|
|
name = "math-parser"
|
|
description = "Parser for Graphite style mathematics expressions"
|
|
version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
repository.workspace = true
|
|
readme.workspace = true
|
|
homepage.workspace = true
|
|
rust-version.workspace = true
|
|
publish.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
thiserror = "2.0"
|
|
num-complex = "0.4"
|
|
unicode-ident = "1.0"
|
|
chumsky = { version = "0.10", default-features = false, features = ["std", "unstable"] }
|
|
|
|
[dev-dependencies]
|
|
criterion = { workspace = true }
|
|
|
|
[[bench]]
|
|
name = "bench"
|
|
harness = false
|