ufff
This commit is contained in:
parent
c8b8dd820e
commit
0e7fffcfe0
67 changed files with 154 additions and 65 deletions
13
src/vm_case_split.c
Normal file
13
src/vm_case_split.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
case OP_SPLIT: {
|
||||
Value sep = pop_value(vm);
|
||||
Value str = pop_value(vm);
|
||||
if (str.type != VAL_STRING || sep.type != VAL_STRING) {
|
||||
fprintf(stderr, "Runtime type error: SPLIT expects (string, string)\n");
|
||||
exit(1);
|
||||
}
|
||||
Value out = bi_split(&str, &sep);
|
||||
free_value(str);
|
||||
free_value(sep);
|
||||
push_value(vm, out);
|
||||
break;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue