@Vadim Petrochenkov do we have an issue for normalizing newlines at file load time? I'd like to look into that. I've actually tried it already and I have questions about the expected behavior of "\r\r\n"
:)
I assumed https://github.com/rust-lang/rust/issues/60604 is the issue.
Ah, that one, about raw byte strings, was closed by https://github.com/rust-lang/rust/pull/60793
expected behavior of "\r\r\n"
Let me check what VC++ does when reading a file with Windows EOL in text mode.
^^ \r\r\n
is read as \r\n
Which seems reasonable since it's the simplest and fastest variant.
And if you have things like \r\r\n
in a text file, it's understandable if the compiler considers it your problem.
The option with erroring on isolated \r
s at load time also looks good to me.
It would allow to do some cleanup in the lexer too.
issue filed, by the way: https://github.com/rust-lang/rust/issues/62865
Yeah, I think I'll go with making this a hard error. This will make handling of "file > 4GB" somewhat cleaner as well.