aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-20 06:52:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-20 06:52:30 +0000
commit1874c344b3b6ef591a5482bb5da10eaa6bb74379 (patch)
treedd7669603e35f7e216ebd92fe163828456dd2ae1 /parse.y
parentcccb946489689f7e63048ef9c8eeb8eee2e7e1fc (diff)
downloadruby-1874c344b3b6ef591a5482bb5da10eaa6bb74379.tar.gz
error.c: SyntaxError#initialize
* error.c (syntax_error_initialize): move the default message, "compile error", from parse.y. the default parameter should belong to the class definition. * parse.y (yycompile0): use the default parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 1 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 56f4d837c5..e3facb73c8 100644
--- a/parse.y
+++ b/parse.y
@@ -5551,8 +5551,7 @@ yycompile0(VALUE arg)
if (parser->error_p) {
VALUE mesg = parser->error_buffer;
if (!mesg) {
- mesg = rb_fstring_cstr("compile error");
- mesg = rb_exc_new_str(rb_eSyntaxError, mesg);
+ mesg = rb_class_new_instance(0, 0, rb_eSyntaxError);
}
rb_set_errinfo(mesg);
return 0;