summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authormirichi <[email protected]>2013-07-06 08:31:01 +0900
committermirichi <[email protected]>2013-07-06 08:31:01 +0900
commitc3e81aca651100e40a03494c9fcc7b8e84302b0a (patch)
treee7256423448ca4f42f9e11f98bc8881829fd32bb /src/parse.y
parenta01845b502a902ee1de2f34645177e64fafbb551 (diff)
parentd4b8fdd7a56ac17064bfcce75df25f100b4a407c (diff)
downloadmruby-c3e81aca651100e40a03494c9fcc7b8e84302b0a.tar.gz
mruby-c3e81aca651100e40a03494c9fcc7b8e84302b0a.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/parse.y b/src/parse.y
index f5dbdb6fd..fda66e92c 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3293,7 +3293,7 @@ peek_n(parser_state *p, int c, int n)
list = push(list, (node*)(intptr_t)c0);
} while(n--);
if (p->pb) {
- p->pb = push(p->pb, (node*)list);
+ p->pb = append(p->pb, (node*)list);
}
else {
p->pb = list;
@@ -3620,12 +3620,14 @@ parse_string(parser_state *p)
tokadd(p, '\n');
}
else {
- pushback(p, c);
-
- if(type & STR_FUNC_REGEXP)
+ if (type & STR_FUNC_REGEXP) {
tokadd(p, '\\');
-
- tokadd(p, read_escape(p));
+ if (c != -1)
+ tokadd(p, c);
+ } else {
+ pushback(p, c);
+ tokadd(p, read_escape(p));
+ }
if (hinf)
hinf->line_head = FALSE;
}