![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_SPLIT opcode for splitting strings in the VM. More...
Go to the source code of this file.
Functions | |
| if (str.type !=VAL_STRING||sep.type !=VAL_STRING) | |
| free_value (str) | |
| free_value (sep) | |
| push_value (vm, out) | |
Variables | |
| case | OP_SPLIT |
| Value | str = pop_value(vm) |
| Value | out = bi_split(&str, &sep) |
| break | |
Implements the OP_SPLIT opcode for splitting strings in the VM.
This file handles the OP_SPLIT instruction, which splits a string into an array of substrings using a separator. The separator and string are popped from the stack, and the resulting array is pushed back.
Behavior:
Error Handling:
Example: // Bytecode: OP_SPLIT // Stack before: [", ", "a, b, c"] // Stack after: [["a", "b", "c"]]
Definition in file split.c.
| free_value | ( | sep | ) |
| free_value | ( | str | ) |
| if | ( | str.type ! | = VAL_STRING || sep.type != VAL_STRING | ) |
| push_value | ( | vm | , |
| out | ) |