From 226eeaa912df006f2a279b6bc2ccaf72f9a74217 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 00:45:02 +0300 Subject: docs(rpn): fix misleading comments in operations_variables.go - AssignVariable: remove false 'Usage: name value =' claim; the = operator uses AssignLeft, not AssignVariable (which is only used in tests). - UseVariable: remove false 'Usage: varname' claim; this method is not wired into the operator registry and is only used in tests. - AssignLeft: update to note it handles both = and =: operators, not just =:. --- internal/rpn/operations_variables.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/rpn/operations_variables.go b/internal/rpn/operations_variables.go index bf0c469..da233d8 100644 --- a/internal/rpn/operations_variables.go +++ b/internal/rpn/operations_variables.go @@ -8,7 +8,9 @@ import "fmt" // variables operations // AssignVariable assigns a value from stack to a variable. -// Usage: `name value =` +// This is a direct API method that takes the variable name as a parameter +// and pops the value from the stack. It is not the handler for the `=` operator; +// use AssignLeft (for `=` and `=:`) or AssignRight (for `:=`) instead. func (o *Operations) AssignVariable(stack *Stack, name string) error { if name == "" { return fmt.Errorf("variable name cannot be empty") @@ -32,7 +34,8 @@ func (o *Operations) AssignVariable(stack *Stack, name string) error { } // UseVariable pushes a variable's value onto the stack. -// Usage: `varname` (pushes stored value) +// This is a direct API method that takes the variable name as a parameter. +// It is not wired into the operator registry. func (o *Operations) UseVariable(stack *Stack, name string) error { if name == "" { return fmt.Errorf("variable name cannot be empty") @@ -74,7 +77,7 @@ func (o *Operations) ClearVariables() { o.vars.ClearVariables() } -// AssignLeft assigns a value to a variable (for =: operator). +// AssignLeft assigns a value to a variable (for = and =: operators). // Stack order: value name =: (value on bottom, name on top). // This function pops name first (top of stack), then value. // Usage: `value name =:` (e.g., `5 x =:`) -- cgit v1.2.3