added small amount of code to handle break & continue

This commit is contained in:
hyunghwan.chung
2017-01-27 15:25:46 +00:00
parent b7a19a3b14
commit 10ca940d72
3 changed files with 104 additions and 37 deletions

View File

@ -351,12 +351,21 @@ struct moo_iolink_t
moo_iolink_t* link;
};
typedef struct moo_code_t moo_code_t;
struct moo_code_t
{
moo_uint8_t* ptr;
moo_oow_t len;
};
typedef struct moo_code_t moo_code_t;
typedef struct moo_loop_t moo_loop_t;
struct moo_loop_t
{
moo_oow_t startpos;
/* TODO: links of break instructions */
moo_oow_t blkcount; /* number of inner blocks enclosed in squre brackets */
moo_loop_t* next;
};
struct moo_compiler_t
{
@ -495,6 +504,9 @@ struct moo_compiler_t
moo_oow_t* blk_tmprcnt;
moo_oow_t blk_tmprcnt_capa;
/* information about loop constructs */
moo_loop_t* loop;
/* byte code */
moo_code_t code;
moo_oow_t code_capa;