1
0
Fork 0
forked from fun/fun

Added more exception handling after debugging ./examples/byte_for_demo.fun. (0.37.0)

This commit is contained in:
Johannes Findeisen 2025-12-10 23:27:06 +01:00
commit 26ddaf161e
12 changed files with 398 additions and 158 deletions

View file

@ -215,7 +215,12 @@ typedef enum {
OP_SOCK_UNIX_CONNECT, // pops path; returns fd (>0) or 0
// process control
OP_EXIT // pops code (or uses operand) and terminates script with exit code
OP_EXIT, // pops code (or uses operand) and terminates script with exit code
// exceptions (minimal)
OP_TRY_PUSH, // operand = handler ip; push handler onto try-stack
OP_TRY_POP, // pop current handler
OP_THROW // pops error value; if handler -> jump to it (push err), else print and terminate
} OpCode;
typedef struct {