summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-26increment versionv0.4.1mainPaul Buetow
2026-03-26fix modulePaul Buetow
2026-03-26updatePaul Buetow
2026-03-26Update README with details on LLMs used and project purposePaul Buetow
2026-03-26chore: bump version to v0.4.0Paul Buetow
- Extracted RPN assignment handlers to fix SRP violation - Fixed error handling in test files - Removed unused StackOperations struct - Moved integration tests to ./integrationtests folder - Various code quality improvements
2026-03-26refactor: move integration tests to ./integrationtests folderPaul Buetow
Integration tests that use the gt tool directly via exec.Command have been moved from cmd/gt/cli_test.go to integrationtests/cli_test.go. Unit tests in cmd/gt/main_test.go remain in place as they test internal functions (runCommand) rather than the binary. Package declaration changed from 'main' to 'integrationtests'.
2026-03-26Update README to show gt arguments in quotesPaul Buetow
2026-03-26refactor: remove unused StackOperations structPaul Buetow
This struct provided stack manipulation operator implementations but was never used in the codebase. All stack operations are implemented directly in the Operations struct in operations.go.
2026-03-26fix: remove unused variable assignments in test filesPaul Buetow
- internal/repl/repl_test.go: Remove unused state variable assignments - internal/rpn/rpn_test.go: Remove unused result/err variable assignments These changes address golangci-lint 'ineffectual assignment' warnings.
2026-03-26fix: address code quality issues from golangci-lintPaul Buetow
- 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 ':'
2026-03-26refactor: Extract RPN assignment handlers to fix SRP violationPaul Buetow
Created specialized handlers for each assignment operator type: - handleAssignRight (for := operator) - handleAssignLeft (for =: operator) - handleStandardAssign (for = operator) The assignmentHandler uses the Strategy pattern to delegate to specialized handlers based on the assignment operator found in the input. Each handler has a single, well-defined responsibility, addressing the SRP violation in the previous monolithic handleAssignment method. All tests pass and code quality is maintained.
2026-03-26feat: Support piping expressions via stdinPaul Buetow
2026-03-26fix: Register < operator and fix > operator mappingPaul Buetow
2026-03-26delete planPaul Buetow
2026-03-26fix: Handle boolean operators == and != correctlyPaul Buetow
2026-03-26feat: Add integration tests for variable assignments and fix RPN parser bugsPaul Buetow
2026-03-25cleanupPaul Buetow
2026-03-25remove this onePaul Buetow
2026-03-25rpn: fix x =: stack-based variable assignmentPaul Buetow
2026-03-25rpn: Final verification - all unit tests passPaul Buetow
2026-03-25rpn: Add unit test for exact user scenario with x =: incremental assignmentPaul Buetow
2026-03-25rpn: Finalize assignment operators implementationPaul Buetow
2026-03-25rpn: Add unit test for user scenario with x =: taking value from stackPaul Buetow
2026-03-25README: Add fox mascot ASCII art logoPaul Buetow
2026-03-25rpn: Fix incremental assignment with x =: (take value from stack)Paul Buetow
2026-03-25rpn: Implement := and =: operators with incremental assignment supportPaul Buetow
2026-03-25rpn: Add test for incremental assignment with =: operatorPaul Buetow
2026-03-25rpn: Fix := and =: operators semanticsPaul Buetow
2026-03-25rpn: Fix =: operator pop order for REPL modePaul Buetow
2026-03-25rpn: Fix AssignLeft/AssignRight to handle StringNum correctlyPaul Buetow
2026-03-25rpn: Add := and =: assignment operators with = synonymPaul Buetow
2026-03-25code-quality: Various improvements to code quality and thread safetyPaul Buetow
2026-03-25remove CI workflow, badges from READMEPaul Buetow
2026-03-25Rename calculator package to percPaul Buetow
Renamed internal/calculator directory to internal/perc, updated package name from 'calculator' to 'perc', and updated all import references.
2026-03-25docs: Move Rational Number Mode section to after TestingPaul Buetow
The 'Rational Number Mode (Optional)' section was positioned right after the title and before 'Installation', which was confusing for users. This change moves the section to appear after 'Testing' and before 'License', following a more logical documentation flow: 1. What the tool is (title) 2. How to install it 3. How to use it (core features) 4. Optional advanced features (Rational mode) 5. Building and testing 6. License
2026-03-25Fix Ln operation and add comprehensive testsPaul Buetow
- Fixed Ln operation to handle Value conversion before math.Log using Float64() which handles boolean conversion (true → 1, false → 0) - Added TestLnWithBoolean and TestLnEdgeCases tests for comprehensive coverage - Refactored operations.go into separate files (arithmetic.go, boolean_ops.go, hyper.go, stack.go, variable.go) - Removed unused toNumber function from number.go - Added Float64() method to Value struct for boolean conversion
2026-03-25fix: Modulo operation correctly uses Number.Mod for moduloPaul Buetow
2026-03-25fix: Power operation correctly uses Number.Pow for exponentiationPaul Buetow
2026-03-25fix: Divide operation correctly handles zero checking and divisionPaul Buetow
2026-03-25fix: Subtract operation correctly uses Number interfacePaul Buetow
- The Subtract operation pops two values from stack - Uses the Number interface's Sub method for subtraction - Boolean values are correctly handled (true=1, false=0) - All tests pass including boolean-to-number coercion tests
2026-03-25fix: Add operation uses Number interface correctlyPaul Buetow
2026-03-25fix: Add operation correctly uses Number interfacePaul Buetow
2026-03-25refactor: Granular interfaces already exist for Operations structPaul Buetow
The Granular interfaces already exist in internal/rpn/operations.go: - ArithmeticOperator: Add, Subtract, Multiply, Divide, Power, Modulo, Log2, Log10, Ln - BooleanOperator: GT, LT, GTE, LTE, EQ, NEQ - HyperOperator: HyperAdd, HyperSubtract, HyperMultiply, HyperDivide, HyperPower, HyperModulo, HyperLog2, HyperLog10, HyperLn - StackOperator: Dup, Swap, Pop, Show - VariableOperator: ListVariables, ClearVariables - Operator: combines all the above interfaces The Operations struct uses these interfaces through composition, adhering to the Interface Segregation Principle.
2026-03-25refactor: Operator interface already split into granular interfacesPaul Buetow
The Operator interface is already split into: - ArithmeticOperator: Add, Subtract, Multiply, Divide, Power, Modulo, Log2, Log10, Ln - BooleanOperator: GT, LT, GTE, LTE, EQ, NEQ - HyperOperator: HyperAdd, HyperSubtract, HyperMultiply, HyperDivide, HyperPower, HyperModulo, HyperLog2, HyperLog10, HyperLn - StackOperator: Dup, Swap, Pop, Show - VariableOperator: ListVariables, ClearVariables All granular interfaces are properly defined and the Operations struct implements all of them.
2026-03-25refactor: Refactor RPN to use Number interface uniformly for stack valuesPaul Buetow
This commit refactors the internal/rpn package to use the Number interface instead of the old Value struct for stack values. Key changes: 1. Updated Number interface to include IsBool() and Bool() methods for boolean value support 2. Modified Float and Rat types to support boolean mode with: - isBool and boolVal fields - Float64() returns 1 for true, 0 for false - String() returns 'true' or 'false' for boolean values 3. Updated Stack to use []Number instead of []Value 4. Updated all operations to use the Number interface methods directly - Add, Sub, Mul, Div, Pow, Mod now use Float64() for values 5. Updated tests to use NewNumber() with mode parameter instead of NewNumberValue(), and use Float64() instead of Number() Benefits: - Simplified code - no need for toNumber() and NewNumberValue() wrappers - Better type safety - stack values are Number interface instances - Boolean-to-number coercion works correctly in all operations
2026-03-25refactor: Refactor RPN.GetCurrentStack to return []ValuePaul Buetow
2026-03-25refactor: Update GetCurrentStack to return []Value instead of []float64Paul Buetow
- Changed GetCurrentStack() to return []Value to preserve value types - Updated test to use Value.Number() method for comparison - Boolean values are now correctly preserved in stack inspection This ensures that boolean values returned from comparison operators (gt, lt, etc.) are preserved when inspecting the stack.
2026-03-25chore: Clean up backup filePaul Buetow
2026-03-25refactor: Split internal/rpn/rpn.go into separate files for better SRPPaul Buetow
Created new files for better separation of concerns: - internal/rpn/mode.go: CalculationMode enum - internal/rpn/rpn_state.go: RPN struct and state management - internal/rpn/rpn_ops.go: Operator execution and evaluation - internal/rpn/rpn_parse.go: Parsing and assignment handling Original rpn.go now contains only the RPN struct and constructor. Benefits: - Better Single Responsibility Principle (SRP) - Improved code organization and readability - Easier to maintain and test individual components
2026-03-25fix: Log10 operation correctly handles Value conversionPaul Buetow
- toNumber() correctly converts boolean values (true→1, false→0) - toNumber() is called before math.Log10 in the Log10 operation - The validation check (toNumber(a) <= 0) correctly rejects log(0) - All tests pass, including boolean-to-number coercion tests The Log10 operation properly: 1. Pops a Value from the stack 2. Converts it to a number using toNumber() for validation 3. Converts it again using toNumber() for the actual calculation 4. Pushes the result as a NumberValue This is the correct behavior for the Log10 operation.