summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 6 insertions, 8 deletions
diff --git a/parse.y b/parse.y
index 88cde7c681..53c09b6a52 100644
--- a/parse.y
+++ b/parse.y
@@ -6502,16 +6502,14 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
pushback(c);
if (tokadd_string(func, term, paren, &quote->nd_nest,
&enc) == -1) {
- ruby_sourceline = nd_line(quote);
- if (func & STR_FUNC_REGEXP) {
- if (parser->eofp)
+ if (parser->eofp) {
+ if (func & STR_FUNC_REGEXP) {
compile_error(PARSER_ARG "unterminated regexp meets end of file");
- return tREGEXP_END;
- }
- else {
- if (parser->eofp)
+ }
+ else {
compile_error(PARSER_ARG "unterminated string meets end of file");
- return tSTRING_END;
+ }
+ quote->u2.id = -1;
}
}