summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-12 07:41:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-12 07:41:35 +0000
commit14a730e91ee6176cc60ba3fc1cd368e47bd2f7b0 (patch)
tree4d355f722daedd8acdb45a77c0dbaf239f2713b3 /compile.c
parent257fd90166f62943ff767e5cd7b0624c12074a8b (diff)
immediate message mode of compile error
* compile.c (append_compile_error): set Qtrue for erred state with showing the message immediately. * iseq.c (prepare_iseq_build): make immediate message mode if main or top level context, not to show the failed path twice in the first line. * iseq.c (cleanup_iseq_build): raise default message exception if immediate message mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 9b0fbfa986..e521a27e6c 100644
--- a/compile.c
+++ b/compile.c
@@ -337,7 +337,7 @@ append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
{
VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info;
VALUE file = iseq->body->location.path;
- VALUE err = err_info;
+ VALUE err = err_info == Qtrue ? Qfalse : err_info;
va_list args;
va_start(args, fmt);
@@ -347,6 +347,9 @@ append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err);
rb_set_errinfo(err);
}
+ else if (!err_info) {
+ RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qtrue);
+ }
}
static void