Open me-and opened 4 months ago
The following is a valid Nix file:
{ value = '' ''\'''${ ''; }
This file produces an error with Alejandra:
$ alejandra test.nix Checking style in 1 file using 9 threads. Failed! 1 error found at: - test.nix: unexpected end of file, wanted any of [TOKEN_STRING_END, TOKEN_STRING_CONTENT, TOKEN_INTERPOL_START]
But it's parsed as expected by nix:
nix
$ nix --extra-experimental-features nix-command eval --read-only --file ./test.nix --raw value '${
As a workaround, I can use ${"'"} to escape the single quote, rather than ''\', but this shouldn't be necessary as both are valid syntax.
${"'"}
''\'
This is possibly related to #194, although I'm not sure if it's fundamentally the same problem or a different problem in a related area.
The following is a valid Nix file:
This file produces an error with Alejandra:
But it's parsed as expected by
nix
:As a workaround, I can use
${"'"}
to escape the single quote, rather than''\'
, but this shouldn't be necessary as both are valid syntax.