![]() | Fun 0.41.5 The programming language that makes You have fun |
VM opcode snippet for loading a JSON document from a file. More...
Go to the source code of this file.
Functions | |
| free_value (vpath) | |
| push_value (vm, make_nil()) | |
Variables | |
| case | OP_JSON_FROM_FILE |
| break | |
VM opcode snippet for loading a JSON document from a file.
This snippet is included by vm.c and implements the OP_JSON_FROM_FILE instruction. It expects a path on the VM stack, reads the file using json-c, converts the resulting json_object tree into a Fun Value, and pushes that Value back on the VM stack.
Build gating: compiled only when FUN_WITH_JSON is enabled (json-c available). When disabled, the opcode consumes its argument (if any) and pushes Nil.
Stack effect (with FUN_WITH_JSON):
Errors and edge cases:
Definition in file from_file.c.
| free_value | ( | vpath | ) |
| push_value | ( | vm | , |
| make_nil() | ) |
| break |
Definition at line 58 of file from_file.c.
| case OP_JSON_FROM_FILE |
Definition at line 35 of file from_file.c.