nixfmt
nixfmt copied to clipboard
Error when carriage return used as linebreak in comment
Description
nixfmt
errors when a carriage return is used as a linebreak in a comment.
Small example input
{
x = #^M1;
}
(Where ^M
is a literal carriage return character.)
We can see that nix-instantiate
parses the file OK:
$ xxd crlf.nix
00000000: 7b0a 2020 7820 3d20 230d 313b 0a7d 0a {. x = #.1;.}.
$ nix-instantiate --parse crlf.nix
{ x = 1; }
Actual output
crlf.nix:2:8:
|
1;| x = #
| ^^^^
unexpected "<carriage return>1;<newline>}<newline>"
expecting expression