@@ -268,7 +268,7 @@ public static ListNode parseWordsString(ParsedString rawStr) {
268
268
return list ;
269
269
}
270
270
271
- public static OperatorNode parseRegexReplace (EmitterContext ctx , ParsedString rawStr ) {
271
+ public static OperatorNode parseRegexReplace (EmitterContext ctx , ParsedString rawStr , Parser parser ) {
272
272
String operator = "replaceRegex" ;
273
273
Node parsed = parseRegexString (ctx , rawStr );
274
274
String replaceStr = rawStr .buffers .get (1 );
@@ -278,7 +278,7 @@ public static OperatorNode parseRegexReplace(EmitterContext ctx, ParsedString ra
278
278
if (modifierStr .contains ("e" )) {
279
279
// if modifiers include `e`, then parse the `replace` code
280
280
ctx .logDebug ("regex e-modifier: " + replaceStr );
281
- Parser blockParser = new Parser (ctx , new Lexer (replaceStr ).tokenize ());
281
+ Parser blockParser = new Parser (ctx , new Lexer (replaceStr ).tokenize (), parser . getHeredocNodes () );
282
282
replace = ParseBlock .parseBlock (blockParser );
283
283
} else if (rawStr .secondBufferStartDelim != '\'' ) {
284
284
// handle string interpolaton
@@ -431,7 +431,7 @@ public static Node parseRawString(Parser parser, String operator) {
431
431
case "/=" :
432
432
return parseRegexMatch (parser .ctx , operator , rawStr );
433
433
case "s" :
434
- return parseRegexReplace (parser .ctx , rawStr );
434
+ return parseRegexReplace (parser .ctx , rawStr , parser );
435
435
case "\" " :
436
436
case "qq" :
437
437
return StringDoubleQuoted .parseDoubleQuotedString (parser .ctx , rawStr , true , true , false , parser .getHeredocNodes ());
0 commit comments