* parse.y (str_extend): should not terminate string interpolation
with newlines in here-docs and newline terminated strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
04f27f5e8d
commit
24b3a3e748
@ -1,3 +1,8 @@
|
|||||||
|
Tue Nov 20 01:07:13 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (str_extend): should not terminate string interpolation
|
||||||
|
with newlines in here-docs and newline terminated strings.
|
||||||
|
|
||||||
Mon Nov 19 17:58:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Nov 19 17:58:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
|
* eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
|
||||||
|
3
parse.y
3
parse.y
@ -2901,7 +2901,7 @@ here_document(term, indent)
|
|||||||
lex_pbeg = lex_p = RSTRING(line)->ptr;
|
lex_pbeg = lex_p = RSTRING(line)->ptr;
|
||||||
lex_pend = lex_p + RSTRING(line)->len;
|
lex_pend = lex_p + RSTRING(line)->len;
|
||||||
retry:
|
retry:
|
||||||
switch (parse_string(term, '\n', '\n')) {
|
switch (parse_string(term, '\n', 0)) {
|
||||||
case tSTRING:
|
case tSTRING:
|
||||||
case tXSTRING:
|
case tXSTRING:
|
||||||
rb_str_cat2(yylval.val, "\n");
|
rb_str_cat2(yylval.val, "\n");
|
||||||
@ -4038,6 +4038,7 @@ str_extend(list, term)
|
|||||||
newtok();
|
newtok();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
case '\n':
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -865,6 +865,13 @@ s = "a string"
|
|||||||
s[0..s.size]="another string"
|
s[0..s.size]="another string"
|
||||||
test_ok(s == "another string")
|
test_ok(s == "another string")
|
||||||
|
|
||||||
|
s = <<EOS
|
||||||
|
#{
|
||||||
|
[1,2,3].join(",")
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
test_ok(s == "1,2,3\n")
|
||||||
|
|
||||||
test_check "assignment"
|
test_check "assignment"
|
||||||
a = nil
|
a = nil
|
||||||
test_ok(defined?(a))
|
test_ok(defined?(a))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user