Skip to content

[cli] Add interactive REPL#205

Merged
forfudan merged 6 commits intodevfrom
cli
Apr 12, 2026
Merged

[cli] Add interactive REPL#205
forfudan merged 6 commits intodevfrom
cli

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 12, 2026

This PR adds an interactive REPL mode to the Decimo CLI so decimo with no arguments (and TTY stdin) launches an interactive calculator session, aligning CLI UX with tools like bc. The PR also updates related CLI docs/changelog and refines benchmark comparison logic.

Changes:

  • Launch REPL when no expression/file is provided and stdin is a TTY; add REPL implementation, prompt writer, and line-reading helper.
  • Update CLI docs/changelog to describe REPL mode and revise the CLI benchmark script to compare full-precision digits (with a guard digit).
  • Normalize various docstrings to use single-backtick inline code formatting.

@forfudan forfudan requested a review from Copilot April 12, 2026 14:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an interactive REPL mode to the Decimo CLI so decimo with no arguments (and TTY stdin) launches an interactive calculator session, aligning CLI UX with tools like bc. The PR also updates related CLI docs/changelog and refines benchmark comparison logic.

Changes:

  • Launch REPL when no expression/file is provided and stdin is a TTY; add REPL implementation, prompt writer, and line-reading helper.
  • Update CLI docs/changelog to describe REPL mode and revise the CLI benchmark script to compare full-precision digits (with a guard digit).
  • Normalize various docstrings to use single-backtick inline code formatting.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/decimo/errors.mojo Docstring inline-code formatting updates.
src/decimo/bigint/bigint.mojo Docstring inline-code formatting update.
src/decimo/bigfloat/mpfr_wrapper.mojo Docstring inline-code formatting updates.
src/decimo/bigdecimal/bigdecimal.mojo Docstring inline-code formatting updates.
src/cli/main.mojo Switch no-args TTY behavior to REPL launch; keeps other modes intact.
src/cli/calculator/tokenizer.mojo Docstring inline-code formatting update.
src/cli/calculator/repl.mojo New REPL implementation (read/eval/print loop, banner, exit handling, caret diagnostics).
src/cli/calculator/io.mojo Add read_line() helper for REPL input (getchar-based).
src/cli/calculator/display.mojo Add write_prompt() to print a styled prompt to stderr.
src/cli/calculator/init.mojo Export new REPL/prompt/line-reading APIs.
docs/plans/cli_calculator.md Update roadmap/design notes to reflect REPL-first approach (no subcommands).
docs/changelog.md Add changelog entry for interactive REPL feature.
benches/cli/bench_cli.sh Revise correctness comparison to full-precision matching and split bc/python counters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@forfudan forfudan merged commit 76f1c0b into dev Apr 12, 2026
11 checks passed
@forfudan forfudan deleted the cli branch April 12, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants