summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/rpn/operations_interfaces.go9
-rw-r--r--internal/rpn/rpn_state.go2
2 files changed, 10 insertions, 1 deletions
diff --git a/internal/rpn/operations_interfaces.go b/internal/rpn/operations_interfaces.go
index e659644..f317f8a 100644
--- a/internal/rpn/operations_interfaces.go
+++ b/internal/rpn/operations_interfaces.go
@@ -152,6 +152,15 @@ type OperationsProvider interface {
CustomMetricManager
}
+// OperatorRegistryProvider defines the methods RPN needs from the operator registry.
+// RPN depends on this interface (DIP) rather than the concrete *OperatorRegistry type.
+type OperatorRegistryProvider interface {
+ IsStandardOperator(token string) bool
+ IsHyperOperator(token string) bool
+ HandleStandardOperator(stack *Stack, token string) (string, bool, error)
+ HandleHyperOperator(stack *Stack, token string) (string, bool, error)
+}
+
// Operator implementations are split across focused sub-interfaces
// (ArithmeticOperator, LogarithmicOperator, MetricOperator, BooleanOperator,
// HyperOperator, StackOperator, VariableOperator, ConstantOperator,
diff --git a/internal/rpn/rpn_state.go b/internal/rpn/rpn_state.go
index a42372a..f2cc4ed 100644
--- a/internal/rpn/rpn_state.go
+++ b/internal/rpn/rpn_state.go
@@ -15,7 +15,7 @@ type RPN struct {
vars VariableStore
consts ConstantsProvider
ops OperationsProvider
- opRegistry *OperatorRegistry
+ opRegistry OperatorRegistryProvider
maxStack int
currentStack *Stack
}