This patch fixes clang-format lexer token handling when parsing source file with CRLF line endings.
The original bug I discovered:
#define MACRO(x) \ private: \ int x(int a);
was formatted correctly with LF line endings and incorrectly with CRLF line endings. In the latter case a new line was inserted before private, because it was incorrectly recognized as an identifier instead of a keyword.
The relevant code section was fixed and the affected test was updated to include CRLF versions of the test inputs as well. These test failed before and run successfully now.
Hm, this does more. Why not just keep the DOS \r\n and the Unix \n cases, as these are the cases we're testing for? Also, please clang-format this patch.