Skip to content

Commit e3e6b9a

Browse files
authored
Merge pull request #148 from fglock/fix-q-sequences-safe
Fix \Q idempotence in quotemeta mode
2 parents a10c0af + c5b001d commit e3e6b9a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/perlonjava/parser/StringDoubleQuoted.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ protected void parseEscapeSequence() {
357357
applyCaseModifier(caseModifiers.pop());
358358
}
359359
inQuotemeta = false;
360+
} else if (token.text.startsWith("Q")) {
361+
// In quotemeta mode, \Q is idempotent and should be ignored.
362+
TokenUtils.consumeChar(parser);
360363
} else {
361364
// Everything else is literal, including the backslash
362365
currentSegment.append("\\");

0 commit comments

Comments
 (0)