Expand description
Calculator DSL Module
This module provides a complete calculator that can parse and evaluate a custom DSL with variables, arithmetic operations, and reference-with-modifier syntax.
Structs§
- Assign
- A single assignment statement (e.g.,
a = 2) - Calc
Result - Result of evaluating a calculator program
- Calculator
- Calculator engine that parses and evaluates DSL programs
- Math
Operators - Math operators implementation for the calculator DSL
Enums§
Functions§
- eval_
expr - Evaluate an expression in the given environment
- parse_
program - Parse a calculator DSL program into a list of assignments
- run_
program - Run a program (list of assignments) and return the final environment