mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-03 02:51:40 +00:00
String literals in expressions have their escapes decoded once by the lexer
(processEscapeCharacters), then interpolate() decoded every backslash pair a
second time, halving runs of backslashes (\\ -> \, \\\\ -> \\). Output
from an expression diverged from the same string read as input, and from jq.
interpolate() only needs to treat a backslash pair as an escape when it guards
an interpolation paren (\\( -> literal \(); a standalone pair must pass
through unchanged. Guard the skip on a following '(' so plain backslash runs
survive, mirroring the lexer's own \\( special case.
Fixes #2561
|
||
|---|---|---|
| .. | ||
| yqlib | ||