summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 13:02:52 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 13:02:52 +0000
commitac83fcdc8ea49cdf30174b452793510d16179642 (patch)
tree0af7fe24cd63676ca70b07b2e75d75b91f9defc9 /parse.y
parent1cdb944024d0a30bc3730186448ab5bb5862b8e4 (diff)
merges r29410 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@29572 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 15fb4912ef..ff683a38b4 100644
--- a/parse.y
+++ b/parse.y
@@ -3890,7 +3890,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;
}