This revision was automatically updated to reflect the committed changes.
Closed by commit rGa70549ae43df: [clang-format] Fix DefSeparator empty line
issues (authored by ksyx).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119067/new/
https://review
ksyx marked an inline comment as done.
ksyx added inline comments.
Comment at: clang/unittests/Format/DefinitionBlockSeparatorTest.cpp:305
" int r = j / k;\n"
+ " if (struct S = getS()) {\n"
+ "// if condition
curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.
LGTM.
Comment at: clang/unittests/Format/DefinitionBlockSeparatorTest.cpp:305
" int r = j / k;\n"
+ " if (struct S = getS())
ksyx updated this revision to Diff 406309.
ksyx added a comment.
Use for loop to go through tokens in a line.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119067/new/
https://reviews.llvm.org/D119067
Files:
clang/lib/Format/DefinitionBlockSeparator.cpp
clang/unittests/Format/Defin
owenpan added inline comments.
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:50-64
FormatToken *CurrentToken = Line->First;
+int BracketLevel = 0;
while (CurrentToken) {
- if (CurrentToken->isOneOf(tok::kw_class, tok::kw_struct) ||
- (Style
ksyx updated this revision to Diff 406271.
ksyx added a comment.
- Remove return after else
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119067/new/
https://reviews.llvm.org/D119067
Files:
clang/lib/Format/DefinitionBlockSeparator.cpp
clang/unittests/Format/DefinitionBlockSeparato
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:41
+ return 1;
+else if (Tok->isOneOf(tok::r_brace, tok::r_paren, tok::r_square))
+ return -1;
This is also an else after return. ;)
CHANGES SINCE
ksyx updated this revision to Diff 406245.
ksyx marked 3 inline comments as done.
ksyx edited the summary of this revision.
ksyx added a comment.
- Add or remove empty lines surrounding `union`s.
- Move new test location.
- Remove else immediately above return.
CHANGES SINCE LAST ACTION
https:
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
curdeius requested changes to this revision.
curdeius added a comment.
This revision now requires changes to proceed.
Looks ok but please rework the tests to keep previous cases untouched.
Comment at: clang/unittests/Format/DefinitionBlockSeparatorTest.cpp:305
ksyx created this revision.
ksyx added reviewers: MyDeveloperDay, curdeius, HazardyKnusperkeks.
ksyx added a project: clang-format.
ksyx requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This commit fixes https://github.com/llvm/llvm-project/
11 matches
Mail list logo