mruby should print error properly

This commit is contained in:
Yukihiro Matsumoto
2012-07-14 15:39:53 +09:00
parent afb983e26f
commit 72f7c51bc0
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -196,9 +196,12 @@ main(int argc, char **argv)
v = mrb_load_file_cxt(mrb, args.rfp, c);
}
mrbc_context_free(mrb, c);
if (!mrb->exc && args.check_syntax) {
if (args.check_syntax) {
printf("Syntax OK\n");
}
else if (!mrb_undef_p(v) && mrb->exc) {
mrb_p(mrb, mrb_obj_value(mrb->exc));
}
}
cleanup(mrb, &args);