From 946fac7d813f6283c18087a46b9e2ee084852c64 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 28 Feb 2026 16:04:22 +0200 Subject: Decouple functions.c from interpreter array-LHS private state [Coupling] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit functions.c::_op_assign() was reading p_interpret->p_token_array_lhs and p_interpret->i_array_lhs_index directly — a hidden cross-module coupling where the functions module reached into interpreter-private state. Pass the array-LHS context as explicit parameters instead: - _op_assign() gains Token *p_array_lhs, int i_lhs_idx params - _process() propagates them to _op_assign() - function_process() propagates them from the call site In interpret.c the "restore" lines that set p_interpret->p_token_array_lhs and p_interpret->i_array_lhs_index before calling function_process() are removed; instead p_lhs and i_lhs_idx are passed directly. The three non-array-LHS call sites pass NULL / 0. _op_assign() no longer touches Interpret internals for the array assignment path. Co-Authored-By: Claude Sonnet 4.6 --- tags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tags') diff --git a/tags b/tags index def4b29..15c91fa 100644 --- a/tags +++ b/tags @@ -102,7 +102,7 @@ _next ./src/core/interpret.c /^_next(Interpret *p_interpret) {$/;" f typeref:typ _next_tt ./src/core/interpret.c /^_next_tt(Interpret *p_interpret) {$/;" f typeref:typename:TokenType _op_add ./src/core/functions.c /^_op_add(Token *p_store, Token *p_next, TokenType tt_highest) {$/;" f typeref:typename:void file: _op_and ./src/core/functions.c /^_op_and(Token *p_store, Token *p_next, TokenType tt_highest) {$/;" f typeref:typename:void file: -_op_assign ./src/core/functions.c /^_op_assign(Interpret *p_interpret, Token *p_token_store) {$/;" f typeref:typename:void file: +_op_assign ./src/core/functions.c /^_op_assign(Interpret *p_interpret, Token *p_token_store,$/;" f typeref:typename:void file: _op_div ./src/core/functions.c /^_op_div(Token *p_store, Token *p_next, TokenType tt_highest) {$/;" f typeref:typename:void file: _op_eq ./src/core/functions.c /^_op_eq(Token *p_store, Token *p_next, TokenType tt_highest) {$/;" f typeref:typename:void file: _op_ge ./src/core/functions.c /^_op_ge(Token *p_store, Token *p_next, TokenType tt_highest) {$/;" f typeref:typename:void file: -- cgit v1.2.3