[PATCH] D119067: [clang-format] Fix DefinitionBlockSeparator extra empty lines
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 6 04:12:33 PST 2022
HazardyKnusperkeks added inline comments.
================
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:39
+ auto GetBracketLevelChange = [](const FormatToken *Tok) {
+ if (Tok->isOneOf(tok::l_brace, tok::l_paren, tok::l_square))
+ return 1;
----------------
I would prefer a switch over the tokens.
But definitely no else after return.
================
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:55
+ if (BracketLevel == 0) {
+ if ((CurrentToken->isOneOf(tok::kw_class, tok::kw_struct) ||
+ (Style.isJavaScript() &&
----------------
What about union?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119067/new/
https://reviews.llvm.org/D119067
More information about the cfe-commits
mailing list