summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-04 03:43:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-04 03:43:50 +0000
commitd3dabbca718a64083b154e03227d9f0c099401ff (patch)
tree04c7aabfedbcf6bca8cc052daa2b7ac27c36a579 /parse.y
parent25eebc3ad5579b1f1da0e355b2d150769ac9396f (diff)
* parse.y (regexp): dregexp has literal string only at the head
and successors are array. [ruby-core:32682] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 1c500525ec..1cb37b41b8 100644
--- a/parse.y
+++ b/parse.y
@@ -3897,7 +3897,8 @@ regexp : tREGEXP_BEG regexp_contents tREGEXP_END
if (nd_type(list->nd_head) == NODE_STR) {
VALUE tail = list->nd_head->nd_lit;
if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) {
- if (!literal_concat0(parser, prev->nd_lit, tail)) {
+ VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
+ if (!literal_concat0(parser, lit, tail)) {
node = 0;
break;
}