owenpan added a comment. Is this patch NFC?
================ Comment at: clang/lib/Format/FormatTokenLexer.cpp:859-867 + switch (Cur[0]) { + case '\n': + case '\r': + case '\f': + case '\v': + case ' ': + case '\t': ---------------- I'd replace the `switch` with `if (isspace(Cur[0])) ... else if (Cur[1] == '\n' ...) ...`. ================ Comment at: clang/lib/Format/FormatTokenLexer.cpp:914 + auto LeadingWhitespace = countLeadingWhitespace(FormatTok->TokenText); + if (!LeadingWhitespace) + break; ---------------- ================ Comment at: clang/lib/Format/FormatTokenLexer.cpp:923-924 + case '\r': + if (i + 1 < e && Text[i + 1] == '\n') + break; + LLVM_FALLTHROUGH; ---------------- `\r\n` is a newline on Windows. ================ Comment at: clang/lib/Format/FormatTokenLexer.cpp:930 + FormatTok->HasUnescapedNewline = true; + InEscape = false; FormatTok->LastNewlineOffset = WhitespaceLength + i + 1; ---------------- ================ Comment at: clang/lib/Format/FormatTokenLexer.cpp:946-948 + case '?': + case '/': + InEscape = true; ---------------- Don't you need to look ahead for a `??/`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124748/new/ https://reviews.llvm.org/D124748 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits