![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_INDEX_SET opcode for array and map assignment in the VM. More...

Go to the source code of this file.
Functions | |
| if (container.type==VAL_ARRAY) | |
| exit (1) | |
Variables | |
| case | OP_INDEX_SET |
| Value | idx = pop_value(vm) |
| Value | container = pop_value(vm) |
| else | |
| break | |
Implements the OP_INDEX_SET opcode for array and map assignment in the VM.
This file handles the OP_INDEX_SET instruction, which assigns a value to an element in an array or a key in a map.
Behavior:
Error Handling:
Example: // Bytecode: OP_INDEX_SET // Stack before: [42, 1, [10, 20, 30]] // Stack after: [[10, 42, 30]]
Definition in file index_set.c.
| exit | ( | 1 | ) |
| if | ( | container. | type = = VAL_ARRAY | ) |
| break |
Definition at line 66 of file index_set.c.
| Value container = pop_value(vm) |
Definition at line 35 of file index_set.c.
| else |
Definition at line 62 of file index_set.c.
| Value idx = pop_value(vm) |
Definition at line 34 of file index_set.c.
| case OP_INDEX_SET |
Definition at line 32 of file index_set.c.