From 01aa0f9a4bcdd23dae3a816959ff640bf354ba56 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 13 Feb 2006 04:53:22 +0000 Subject: * parse.y (parser_parse_string): mention "regexp" in a error message. a patch from Mauricio Fernandez [ruby-core:07340] * eval.c (rb_f_autoload): check if ruby_cbase is nil (during instance_eval for objects cannot have singleton classes, e.g. fixnums and symbols). [ruby-dev:28178] * gc.c (rb_gc_call_finalizer_at_exit): turn on during_gc while invoking finalizers. * gc.c (rb_gc_finalize_deferred): ditto. * io.c (rb_write_error2): use fwrite(3) if rb_stderr is not updated or is already freed. [ruby-dev:28313] * eval.c (error_line): include the class name of a surrounding method in error position description. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 41de56b9d..d7af518fd 100644 --- a/parse.y +++ b/parse.y @@ -5194,9 +5194,16 @@ parser_parse_string(struct parser_params *parser, NODE *quote) } pushback(c); if (tokadd_string(func, term, paren, "e->nd_nest) == -1) { - ruby_sourceline = nd_line(quote); - rb_compile_error(PARSER_ARG "unterminated string meets end of file"); - return tSTRING_END; + if (func & STR_FUNC_REGEXP) { + ruby_sourceline = nd_line(quote); + rb_compile_error(PARSER_ARG "unterminated regexp meets end of file"); + return tREGEXP_END; + } + else { + ruby_sourceline = nd_line(quote); + rb_compile_error(PARSER_ARG "unterminated string meets end of file"); + return tSTRING_END; + } } tokfix(); -- cgit