aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-26 07:13:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-26 07:13:43 +0000
commit5050521aace8eae4e854284ff60036df9ab4f663 (patch)
tree49d111e3ac50946cf5ab514ac6ba49fc81b6bd7e /parse.y
parentff2f8fba4237edca3a1edabbced53cf36091895d (diff)
downloadruby-5050521aace8eae4e854284ff60036df9ab4f663.tar.gz
parse.y: unterminated content token
* parse.y (parser_parse_string): defer the end token to next reading, to yield tSTRING_CONTENT with the unterminated content. [Bug #13363] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 6 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index 4275f245b8..d0f43156e9 100644
--- a/parse.y
+++ b/parse.y
@@ -6207,15 +6207,14 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
pushback(c);
if (tokadd_string(func, term, paren, &quote->nd_nest,
&enc) == -1) {
- 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 = STR_TERM_END;
}
}