1
0
Fork 0
forked from fun/fun

Added echo to output data wthout a newline. (0.36.2)

This commit is contained in:
Johannes Findeisen 2025-12-10 00:31:07 +01:00
commit 9fabf86e61
2 changed files with 35 additions and 0 deletions

12
src/vm/echo.c Normal file
View file

@ -0,0 +1,12 @@
/**
* Implements OP_ECHO: print top-of-stack value without trailing newline.
* Does not store into VM output buffer; writes directly to stdout and flushes.
*/
case OP_ECHO: {
Value v = pop_value(vm);
print_value(&v);
fflush(stdout);
free_value(v);
break;
}