Open tarunbhm opened 3 months ago
The recent changes introduce a new module for simplifying expressions, handle negative values more effectively, and adjust the parser to support unsigned integers and negative expressions. Tests were added to ensure correct handling of various arithmetic operations. Updates to the FormulaConfig
struct allow for more flexible initialization, and the latex_generator
now properly formats negative expressions.
Files | Change Summary |
---|---|
README.md |
Clarified the purpose of the formula field regarding numeric literals. |
src/analyzer.rs |
Added simplify_expr module, updated analyze function, and added tests. |
src/analyzer/analyze_rounding.rs |
Updated visit function to handle Expr::Negative . |
src/analyzer/ast.rs |
Changed Number type to u32 , added Negative variant to Expr . |
src/analyzer/simplify_expr.rs |
Introduced functions to simplify expressions, handle negative values. |
src/parser/arithmetic.lalrpop |
Adjusted grammar rules for handling negative numbers and identifiers. |
src/parser/formula_config.rs |
Added new function for FormulaConfig struct initialization. |
src/parser/input.rs |
Added Expr::Negative pattern to visit function. |
src/printer/latex_generator.rs |
Added case for Expr::Negative in visit function, formatting output. |
In the land of code where numbers dance,
We’ve given negatives a fairer chance.
Simplified expressions, clear and bright,
Parsing integers with all our might.
With formulas new and tests in sight,
Our code now shines, a beacon of light.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
FormulaConfig
with specific parameters.Bug Fixes
Documentation
formula
field in the README.Tests
Enhancements