summaryrefslogtreecommitdiff
path: root/src/core/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/functions.c')
-rw-r--r--src/core/functions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/functions.c b/src/core/functions.c
index 76b4eed..a448f84 100644
--- a/src/core/functions.c
+++ b/src/core/functions.c
@@ -148,6 +148,16 @@ _process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op,
switch (tt_op) {
case TT_ASSIGN:
{
+ /* Array element assignment: arr[i] = val */
+ if (p_interpret->p_token_array_lhs != NULL) {
+ array_set(p_interpret->p_token_array_lhs->p_array,
+ p_interpret->i_array_lhs_index,
+ p_token_store);
+ p_interpret->p_token_array_lhs = NULL;
+ return;
+ }
+
+ /* Regular variable assignment */
Token *p_token_assign = p_interpret->p_token_temp;
TokenType tt_assign = token_get_tt(p_token_assign);