refactor(formula): trust grammar invariants in parser

Refactor the formula parser to assume grammar invariants, replacing
Result-based error handling in tree walkers with infallible functions and
.expect(GRAMMAR_INVARIANT) calls.

This simplification is based on the guarantee that the Pest grammar already
validates the input structure. To verify these invariants and ensure
correctness, extensive new unit tests and property-based tests using
proptest have been added.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
This commit is contained in:
Edward Langley
2026-04-15 04:32:14 -07:00
parent dba8a5269e
commit 5fbc73269f
3 changed files with 607 additions and 170 deletions

2
Cargo.lock generated
View File

@ -758,6 +758,8 @@ dependencies = [
"anyhow",
"pest",
"pest_derive",
"pest_meta",
"proptest",
"serde",
]