Conversation
There was a problem hiding this comment.
Pull request overview
Adds a REPL configuration system so users can change calculator display/computation options via :... meta-commands or inline expr:... one-off overrides.
Changes:
- Introduce
Settings,parse_settings, andsplit_inline_settingsfor REPL configuration parsing. - Integrate settings/meta-commands + inline overrides into the REPL loop; add extensive unit tests for the settings parser.
- Expand docstrings across CLI calculator modules and update planning/docs; adjust CLI delimiter flag (removes
-D).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/decimal128/test_decimal128_from_int.mojo | Fixes Decimal128.from_int(..., scale) calls to pass UInt32 scales. |
| tests/cli/test_settings.mojo | Adds thorough tests for settings parsing and inline settings splitting. |
| src/cli/main.mojo | Removes the -D short flag for --delimiter. |
| src/cli/calculator/tokenizer.mojo | Adds docstrings for token kinds and tokenizer helpers. |
| src/cli/calculator/settings.mojo | New settings model + parser and inline-settings splitter. |
| src/cli/calculator/repl.mojo | REPL now supports : meta-commands and inline expr:settings overrides via Settings. |
| src/cli/calculator/parser.mojo | Docstring improvements (args/returns). |
| src/cli/calculator/io.mojo | Docstring improvements (args/returns/examples). |
| src/cli/calculator/evaluator.mojo | Docstring improvements (args/returns). |
| src/cli/calculator/engine.mojo | Docstring improvements (args/returns). |
| src/cli/calculator/display.mojo | Docstring improvements and more documented ANSI constants. |
| src/cli/calculator/init.mojo | Re-exports the new settings API. |
| pixi.toml | Extends doc-generation task to include CLI calculator modules. |
| docs/plans/line_editor.md | Adds a detailed future plan for a Mojo line editor package. |
| docs/plans/cli_calculator.md | Updates roadmap/status notes for REPL features and CLI flag naming. |
Comments suppressed due to low confidence (1)
src/cli/main.mojo:81
- Removing the delimiter short option (
-D) is a breaking CLI change and will cause existing CLI integration tests and docs to fail (e.g.tests/test_cli.shanddocs/user_manual_cli.mdstill use-D). Either restore the short flag or update the tests/docs (and any completion/help output expectations) to match the new interface.
var delimiter: Option[
String,
long="delimiter",
help="Digit-group separator inserted every 3 digits (e.g. '_' gives 1_234.567_89)",
default="",
value_name="CHAR",
group="Formatting",
]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a REPL configuration system so users can change calculator display/computation options via
:...meta-commands or inlineexpr:...one-off overrides.Changes:
Settings,parse_settings, andsplit_inline_settingsfor REPL configuration parsing.-D).