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 /iseq.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 'iseq.c')
-rw-r--r-- | iseq.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -627,11 +627,13 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE li const INITIALIZED VALUE label = parent ? parent->body->location.label : rb_fstring_cstr("<compiled>"); + VALUE parser = rb_parser_new(); + rb_parser_mild_error(parser); th->base_block = base_block; TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { - NODE *node = (*parse)(rb_parser_new(), file, src, ln); + NODE *node = (*parse)(parser, file, src, ln); if (node) { /* TODO: check err */ iseq = rb_iseq_new_with_opt(node, label, file, absolute_path, line, parent, type, &option); |