| Age | Commit message (Collapse) | Author |
|
MetricReader (task ok)
|
|
Delete internal/repl/calculator.go which defined the Calculator
interface and RPNCalculator adapter. Every method delegated directly
to *rpn.RPN with zero transformation — unnecessary indirection.
RPNState now holds *rpn.RPN directly instead of the Calculator
interface. Updated NewRPNState, NewREPL, handleRatCommand, and
RPNHandler.Handle() to access *rpn.RPN directly.
Removes 71 net lines, zero behavioral changes.
|
|
- Task 31: Refactor repl tests to remove dependency on package-level singletons
- Task 41: Introduce Calculator interface to decouple REPL from RPN engine
- Task 61: Implement persistent variable store with Save/Load methods
- Task 71: Add stack inspection (peek) command to REPL
- Task 81: Expand constants library with additional mathematical constants
- Task a1: Add session logging flag (--log) to gt CLI
- Task 91: Integrate reverse history search (Ctrl+R) using readline
This commit includes:
- New: internal/repl/calculator.go - Calculator interface for RPN decoupling
- New: internal/repl/completer.go - AutoCompleteAdapter for readline
- Modified: internal/repl/repl.go - Uses readline instead of go-prompt
- Modified: internal/rpn/variables.go - Added Save/Load for persistent state
- Modified: internal/rpn/rpn_state.go - Added Stack() method
- Modified: internal/rpn/constants.go - Added more mathematical constants
- Modified: internal/repl/commands.go - Added 'stack' command
- Modified: internal/repl/completer_test.go - Updated for readline API
- Modified: internal/repl/repl_test.go - Updated for Calculator interface
- Modified: internal/repl/concurrent_test.go - Updated for Calculator interface
- Modified: internal/repl/handlers.go - Updated for Calculator interface
- Modified: internal/rpn/variables_test.go - Added Save/Load tests
- Modified: internal/rpn/constants_test.go - Added new constant tests
- Modified: cmd/gt/main.go - Added --log flag support
- Modified: Magefile.go - Symmetrized Install/Uninstall logic
- Deleted: internal/repl/prompt.go - Replaced by readline integration
- Added: STORY.md - Project history documentation
|
|
|
|
- Fix error handling in test files by explicitly ignoring error returns
- Remove trailing punctuation from error message in rpn_parse.go
Test file changes:
- cli_test.go: Use _ = os.Remove() in Cleanup function
- concurrent_test.go: Use _, _ = runRPN() in concurrent goroutines
Code change:
- rpn_parse.go: Changed error message to end with 'colon' instead of ':'
|
|
|