dkt01 updated this revision to Diff 494928.
dkt01 marked an inline comment as done.
dkt01 added a comment.
Changes requested in owenpan's review.
Rebased changes onto latest main branch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
dkt01 marked 4 inline comments as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:123
private:
+ ScopeType getScopeType(FormatToken &Token) {
+switch (Token.getType()) {
owenpan wrote:
> As suggested before.
Oops... missed
dkt01 updated this revision to Diff 494059.
dkt01 added a comment.
Updates recommended by owenpan in review.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnotator.h
cla
dkt01 marked 8 inline comments as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:1195-1198
+ // Handle unbalanced braces.
+ if (!Scopes.empty())
+Scopes.pop_back();
// Lines can start with '}'.
owenpan
dkt01 updated this revision to Diff 493104.
dkt01 added a comment.
Updates suggested in owenpan's review.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnotator.h
clang/
dkt01 marked 11 inline comments as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:1195-1198
+ // Handle unbalanced braces.
+ if (!Scopes.empty())
+Scopes.pop_back();
// Lines can start with '}'.
owenpan
dkt01 updated this revision to Diff 492482.
dkt01 marked an inline comment as done.
dkt01 added a comment.
Changes as suggested in review from owenpan
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
dkt01 marked 11 inline comments as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:1162-1169
+ case TT_EnumLBrace:
+ case TT_ControlStatementLBrace:
+ case TT_ElseLBrace:
+ case TT_BracedListLBrace:
+ case TT_CompoundReq
dkt01 added a comment.
David Turner
Good to know it worked as expected on your project as well.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
dkt01 added a comment.
Sounds good. I don't believe I have permissions to add commits to three repo
anyway, so someone can add on my behalf after the 16 branch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
dkt01 updated this revision to Diff 491823.
dkt01 added a comment.
Changes recommended by HazardyKnusperkeks in review.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnota
dkt01 updated this revision to Diff 490859.
dkt01 added a comment.
Changes as suggested by HazardyKnusperkeks in review.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnot
dkt01 marked an inline comment as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:2544
SmallVector Contexts;
+ static SmallVector Scopes;
HazardyKnusperkeks wrote:
> dkt01 wrote:
> > HazardyKnusperkeks wrote:
> > > Why sta
dkt01 marked an inline comment as done.
dkt01 added inline comments.
Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:181
+ ASSERT_EQ(Tokens.size(), 5u) << Tokens;
+ EXPECT_TOKEN(Tokens[1], tok::amp, TT_BinaryOperator);
+
MyDeveloperDay wrote:
> how do
dkt01 marked an inline comment as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:1205
case tok::r_brace:
+ if (Scopes.size() > 1)
+Scopes.pop_back();
HazardyKnusperkeks wrote:
> How does this happen? The only
dkt01 updated this revision to Diff 489967.
dkt01 added a comment.
Further changes based on HazardyKnusperkeks' review
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/Format
dkt01 updated this revision to Diff 489962.
dkt01 added a reviewer: HazardyKnusperkeks.
dkt01 added a comment.
Changes based on HazardyKnusperkeks' review
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141959/new/
https://reviews.llvm.org/D141959
Files:
clang/lib/Format/TokenAnnotator
dkt01 marked 6 inline comments as done.
dkt01 added inline comments.
Comment at: clang/lib/Format/TokenAnnotator.cpp:2490-2491
+// Opeartors at class scope are likely pointer or reference members
+if (TokScope == ScopeType::Class)
+ return TT_PointerOrReference;
+
--
dkt01 created this revision.
dkt01 added reviewers: MyDeveloperDay, owenpan.
dkt01 added a project: clang-format.
Herald added a project: All.
dkt01 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Token annotator for clang-format incorrectl
19 matches
Mail list logo