yq/pkg
truffle a51671c522
fix(strings): don't halve backslashes in interpolated string literals
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
2026-06-26 03:13:39 +00:00
..
yqlib fix(strings): don't halve backslashes in interpolated string literals 2026-06-26 03:13:39 +00:00