From b01670a3d391de3c7df868a8285e570564ea46cd Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 24 Jun 2013 00:41:34 +0900 Subject: fixed a bug in push back list; close #1298 --- src/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parse.y') diff --git a/src/parse.y b/src/parse.y index f5dbdb6fd..1d5366d17 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; -- cgit v1.2.3 From dfb4d555c4443e78ae530b69a9c96561d8bd38e3 Mon Sep 17 00:00:00 2001 From: Takashi Sogabe Date: Thu, 27 Jun 2013 17:15:18 +0900 Subject: Avoid read_escape() in case of regexp --- src/parse.y | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/parse.y') diff --git a/src/parse.y b/src/parse.y index 1d5366d17..fda66e92c 100644 --- a/src/parse.y +++ b/src/parse.y @@ -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; } -- cgit v1.2.3