aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 10 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 41de56b9d5..d7af518fdf 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, &quote->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();