summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-04 13:12:58 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-04 13:12:58 +0900
commit5f2817b36c32ff71031c514b2fdf51ba6b74d83c (patch)
treeaca47a62cf81bb705720d4897ae4e8df30f5bb8c
parent59cd24d41f1e6b5e25d35103c0720e8aa8cae0b6 (diff)
downloadmruby-5f2817b36c32ff71031c514b2fdf51ba6b74d83c.tar.gz
mruby-5f2817b36c32ff71031c514b2fdf51ba6b74d83c.zip
backslash escapes in regexp should be addressed by Regexp processor; close #2005
-rw-r--r--src/parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parse.y b/src/parse.y
index 2cf1571d3..ec27a2c51 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3829,6 +3829,10 @@ parse_string(parser_state *p)
tokadd(p, '\n');
}
}
+ else if (type & STR_FUNC_REGEXP) {
+ tokadd(p, '\\');
+ tokadd(p, c);
+ }
else {
pushback(p, c);
tokadd(p, read_escape(p));