Code: Select all
// got a line with non-zero length, see if it needs continuing
while (mp_repl_continue_with_input(vstr_null_terminated_str(&line))) {
vstr_add_byte(&line, '\n');
ret = readline(&line, "... ");
if (ret == CHAR_CTRL_C) {
// cancel everything
mp_hal_stdout_tx_str("\r\n");
goto input_restart;
} else if (ret == CHAR_CTRL_D) {
// stop entering compound statement
break;
}
}
Compiling a block (or a file) returns an mp_raw_code_t. If you compile first block then execute it, you'll be executing a mp_raw_code_t and same will be true for the next block and the next . . . until you reach the end of the file.
Question is: how do you combine two mp_raw_code_t into one? It should definitely be possible since each block is independent of the next with respect to compilation.