[PATCH] D94500: Rework Whitesmiths mode to use line-level values in UnwrappedLineParser
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 13 11:59:34 PST 2021
HazardyKnusperkeks added inline comments.
================
Comment at: clang/lib/Format/TokenAnalyzer.cpp:71
Env.getFirstStartColumn(), Style, Encoding, Allocator,
-
IdentTable);
----------------
Unrelated change (although I think it's good one).
================
Comment at: clang/lib/Format/UnwrappedLineParser.h:143
bool tryToParseSimpleAttribute();
- void addUnwrappedLine();
+ void addUnwrappedLine(bool RemoveLevel = true);
bool eof() const;
----------------
A `bool` parameter for something like that is not very nice. An `enum (class)` is much nicer.
If one does not know the declaration `addUnwrappedLine(false)` seems a bit odd, `addUnwrappedLine(LineLevel::Keep)` looks better. (The naming may be changed.)
================
Comment at: clang/unittests/Format/FormatTest.cpp:13528
"namespace B\n"
- " {\n"
+ "{\n"
"class C;\n"
----------------
So until now it has formatted that always wrong?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94500/new/
https://reviews.llvm.org/D94500
More information about the cfe-commits
mailing list