summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-26 15:11:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-26 15:11:32 +0000
commit70da28c1856f884294062c65be330a6b6e6c99cf (patch)
treeaeb10084660235fbb50c7585036ede3331e60ae0
parent0e512b47fc1b53f49ac065c632233e7419b44563 (diff)
parse.y: STR_TERM_END
* parse.y (parser_parse_string): store the end of string literal mark in nd_term instead of nd_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 9f5bfeb171..2a22c082cd 100644
--- a/parse.y
+++ b/parse.y
@@ -5577,6 +5577,7 @@ rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
#define STR_FUNC_SYMBOL 0x10
#define STR_FUNC_INDENT 0x20
#define STR_FUNC_LABEL 0x40
+#define STR_TERM_END -1
enum string_type {
str_label = STR_FUNC_LABEL,
@@ -6349,7 +6350,7 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
int c, space = 0;
rb_encoding *enc = current_enc;
- if (func == -1) return tSTRING_END;
+ if (term == STR_TERM_END) return tSTRING_END;
c = nextc();
if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
do {c = nextc();} while (ISSPACE(c));
@@ -6357,7 +6358,7 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
}
if (c == term && !quote->nd_nest) {
if (func & STR_FUNC_QWORDS) {
- quote->nd_func = -1;
+ quote->u2.id = STR_TERM_END;
return ' ';
}
return parser_string_term(parser, func);
@@ -6794,7 +6795,7 @@ parser_here_document(struct parser_params *parser, NODE *here)
yylval.val, str);
#endif
heredoc_restore(lex_strterm);
- lex_strterm = NEW_STRTERM(-1, 0, 0);
+ lex_strterm = NEW_STRTERM(func, STR_TERM_END, 0);
set_yylval_str(str);
return tSTRING_CONTENT;
}