Conversation
There was a problem hiding this comment.
Pull request overview
This PR initializes a CLI calculator application for the Decimo library, implementing a complete expression evaluator with tokenization, parsing (shunting-yard algorithm), and evaluation using BigDecimal arithmetic. The implementation supports basic arithmetic operations (+, -, *, /), parentheses, and unary negation with arbitrary precision.
Changes:
- Added CLI calculator engine with tokenizer, parser, and evaluator modules
- Implemented comprehensive test suites for each component (tokenizer, parser, evaluator)
- Added CLI entry point with ArgMojo for command-line argument parsing
- Updated project documentation and build configuration
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/main.mojo | CLI entry point using ArgMojo for parsing command-line arguments |
| src/cli/calculator/tokenizer.mojo | Lexical analyzer converting expression strings to tokens |
| src/cli/calculator/parser.mojo | Shunting-yard algorithm converting infix to RPN notation |
| src/cli/calculator/evaluator.mojo | RPN evaluator using BigDecimal for arithmetic operations |
| src/cli/calculator/init.mojo | Package initialization exporting public API |
| tests/cli/test_tokenizer.mojo | Comprehensive tokenizer test suite |
| tests/cli/test_parser.mojo | Parser test suite validating precedence and associativity |
| tests/cli/test_evaluator.mojo | End-to-end evaluator tests |
| tests/test_cli.sh | Shell script to run CLI tests |
| tests/test_all.sh | Updated to include CLI tests |
| pixi.toml | Added CLI build tasks and Python dependency |
| pixi.lock | Updated dependency lockfile |
| docs/readme_unreleased.md | Added project structure section and CLI documentation |
| docs/plans/cli_calculator.md | Added Phase 5 future enhancements |
| .gitignore | Added CLI binary to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Yuhao Zhu: | ||
| # I am seriously thinking that whether I should also support recoginizing | ||
| # full-width digits and operators, so that users can copy-paste expressions from | ||
| # other sources without having to manually convert them. This would be a nice | ||
| # feature for Chinese-Japanese-Korean (CJK) users. | ||
| # But it would also add some complexity to the tokenizer, because these | ||
| # full-width characters have different byte numbers. |
There was a problem hiding this comment.
Corrected spelling of 'recoginizing' to 'recognizing'.
| mojo = "==0.26.1" | ||
| python = ">=3.13,<3.14" |
There was a problem hiding this comment.
The mojo and python dependencies are not in alphabetical order. Consider placing them alphabetically (mojo before python) for consistency with the argmojo entry above.
| | v0.6.0 | ==0.25.7 | pixi | | ||
| | v0.7.0 | ==0.26.1 | pixi | | ||
| | v0.8.0 | ==0.26.1 | pixi | | ||
| | libary | version | Mojo version | package manager | |
There was a problem hiding this comment.
Corrected spelling of 'libary' to 'library'.
| | libary | version | Mojo version | package manager | | |
| | library | version | Mojo version | package manager | |
…ser (#170) This PR initializes a CLI calculator application for the Decimo library, implementing a complete expression evaluator with tokenization, parsing (shunting-yard algorithm), and evaluation using BigDecimal arithmetic. The implementation supports basic arithmetic operations (+, -, *, /), parentheses, and unary negation with arbitrary precision. **Changes:** - Added CLI calculator engine with tokenizer, parser, and evaluator modules - Implemented comprehensive test suites for each component (tokenizer, parser, evaluator) - Added CLI entry point with ArgMojo for command-line argument parsing - Updated project documentation and build configuration
This PR initializes a CLI calculator application for the Decimo library, implementing a complete expression evaluator with tokenization, parsing (shunting-yard algorithm), and evaluation using BigDecimal arithmetic. The implementation supports basic arithmetic operations (+, -, *, /), parentheses, and unary negation with arbitrary precision.
Changes: