mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1310 from iij/pr-fix-regexp-escape
Avoid read_escape() in case of regexp
This commit is contained in:
+7
-5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user