Commit 216eeb0
feat(shell): implement arithmetic expansion (Phase 6 M8)
- Add src/arith.rs with full arithmetic evaluator
- Support all POSIX operators: +, -, *, /, %, **
- Support bitwise: &, |, ^, ~, <<, >>
- Support comparison: <, >, <=, >=, ==, !=
- Support logical: &&, ||, ! (with short-circuit)
- Recursive descent parser with correct precedence
- Variable references in arithmetic expressions
- Division by zero detection
Tested: $((5 + 3)), $((2 ** 10)), $((x * 2))
All arithmetic tests passing (13 unit tests).
Known issue: Nested parens in shell input $(( (expr) )) needs fix.
Core arithmetic functionality complete.
Version: 0.11.0 → 0.12.0
Ref: docs/PHASE6_M8_DESIGN.md
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 6cae9eb commit 216eeb0
6 files changed
Lines changed: 1359 additions & 8 deletions
0 commit comments