diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 05:46:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 05:46:20 +0000 |
commit | bc343b851d04f68ef7554a2cca0bad63a32c2b7d (patch) | |
tree | 34701ea26f297294c1ab55561610227fcd761eba /load.c | |
parent | 22198f9d3c384dbc3e95b953d71a07de12da652b (diff) |
SyntaxError message at iseq compile
* iseq.c (rb_iseq_compile_with_option): make the parser in mild
error.
* load.c (rb_load_internal0): ditto.
* parse.y (yycompile0): return the error message within the error
to be raised. [Feature #11951]
* parse.y (parser_compile_error): accumulate error messages in the
error_buffer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -583,7 +583,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap) int state; volatile VALUE wrapper = th->top_wrapper; volatile VALUE self = th->top_self; - volatile int mild_compile_error; #if !defined __GNUC__ rb_thread_t *volatile th0 = th; #endif @@ -600,7 +599,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap) rb_extend_object(th->top_self, th->top_wrapper); } - mild_compile_error = th->mild_compile_error; TH_PUSH_TAG(th); state = EXEC_TAG(); if (state == 0) { @@ -611,10 +609,10 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap) /* OK */ } else { - th->mild_compile_error++; - node = (NODE *)rb_load_file_str(fname); + VALUE parser = rb_parser_new(); + rb_parser_mild_error(parser); + node = (NODE *)rb_parser_load_file(parser, fname); iseq = rb_iseq_new_top(node, rb_str_new2("<top (required)>"), fname, rb_realpath_internal(Qnil, fname, 1), NULL); - th->mild_compile_error--; } rb_iseq_eval(iseq); } @@ -624,7 +622,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap) th = th0; fname = RB_GC_GUARD(fname); #endif - th->mild_compile_error = mild_compile_error; th->top_self = self; th->top_wrapper = wrapper; |