diff options
| author | Takashi Sogabe <[email protected]> | 2013-06-27 17:15:18 +0900 |
|---|---|---|
| committer | Takashi Sogabe <[email protected]> | 2013-06-27 17:15:18 +0900 |
| commit | dfb4d555c4443e78ae530b69a9c96561d8bd38e3 (patch) | |
| tree | e6ba01378aacd825c5d965bc233f64b1f86514c9 /src/parse.y | |
| parent | b44309b4b208a7649a4e3bfb02b2ae353a3c83fc (diff) | |
| download | mruby-dfb4d555c4443e78ae530b69a9c96561d8bd38e3.tar.gz mruby-dfb4d555c4443e78ae530b69a9c96561d8bd38e3.zip | |
Avoid read_escape() in case of regexp
Diffstat (limited to 'src/parse.y')
| -rw-r--r-- | src/parse.y | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |
