diff options
Diffstat (limited to 'src/3cl.c')
| -rw-r--r-- | src/3cl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/3cl.c b/src/3cl.c index c8016a9..bcadf4d 100644 --- a/src/3cl.c +++ b/src/3cl.c @@ -1,6 +1,7 @@ #include "3cl.h" #include <errno.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -12,6 +13,7 @@ int ccl_init(struct CCL *ccl, const char *code, int (*in)(), void (*out)(int)) *ccl = (struct CCL) { .code = code, + .stopped = false, .in = in, .out = out, .rootframe = (struct CCLFrame) @@ -69,6 +71,10 @@ void ccl_exec(struct CCL *ccl) { struct CCLFrame *curframe = &ccl->rootframe; - for (;;++curframe->ep) + for (;;) + { curframe = ccl_instruction(ccl, curframe); + if (ccl->stopped) + break; + } } |