Added error and warning output from parser.
Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
parent
d5bf9c6f26
commit
2321865084
|
@ -235,6 +235,14 @@ int app_mrb_repl_exec(bool *exit) {
|
||||||
/* TODO: Compile block and feed to VM */
|
/* TODO: Compile block and feed to VM */
|
||||||
/* TODO: Adjust CXT->lineno */
|
/* TODO: Adjust CXT->lineno */
|
||||||
|
|
||||||
|
if(parser->nerr) {
|
||||||
|
printf("Error at line %d: %s\n", parser->error_buffer[0].lineno, parser->error_buffer[0].message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(parser->nwarn) {
|
||||||
|
printf("Warn at line %d: %s\n", parser->warn_buffer[0].lineno, parser->warn_buffer[0].message);
|
||||||
|
}
|
||||||
|
|
||||||
mrb_gc_arena_restore(s_mrb_state, s_gc_arena_idx);
|
mrb_gc_arena_restore(s_mrb_state, s_gc_arena_idx);
|
||||||
|
|
||||||
/* We are done with current block, free buffer */
|
/* We are done with current block, free buffer */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user