![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_PRINT opcode for printing values in the VM. More...
Go to the source code of this file.
Functions | |
| free_value (v) | |
| if (vm->output_count< OUTPUT_SIZE) | |
| fprintf (stderr, "Runtime error: output buffer overflow\n") | |
| exit (1) | |
Variables | |
| case | OP_PRINT |
| Value | snap = deep_copy_value(&v) |
| else | |
| break | |
Implements the OP_PRINT opcode for printing values in the VM.
This file handles the OP_PRINT instruction, which prints the top value on the stack to the output buffer. The value is popped from the stack.
Behavior:
Example: // Bytecode: OP_PRINT // Stack before: [42] // Stack after: []
Definition in file print.c.
| exit | ( | 1 | ) |
| fprintf | ( | stderr | , |
| "Runtime error: output buffer overflow\n" | ) |
| free_value | ( | v | ) |
| else |
| Value snap = deep_copy_value(&v) |