JustBash.Arithmetic (JustBash v0.4.0)
View SourceArithmetic expression parsing and evaluation for bash.
Supports:
- Basic operators: +, -, *, /, %
- Comparison operators: <, <=, >, >=, ==, !=
- Bitwise operators: &, |, ^, ~, <<, >>
- Logical operators: &&, ||, !
- Assignment operators: =, +=, -=, etc.
- Pre/post increment/decrement: ++, --
- Ternary operator: ? :
- Parentheses for grouping
- Variable references
Delegates to:
JustBash.Arithmetic.Parserfor parsingJustBash.Arithmetic.Evaluatorfor evaluation
Summary
Functions
Evaluate an arithmetic AST in the given environment. Returns {result, updated_env}.
Parse an arithmetic expression string into an AST.