[clang] b28ed9c - [clang-format] cleanup from D75517

Jonathan Coe via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 10:32:03 PDT 2020


Author: Jonathan Coe
Date: 2020-03-09T17:31:36Z
New Revision: b28ed9cec8dd7225164eb8c0884aa463654ef3fc

URL: https://github.com/llvm/llvm-project/commit/b28ed9cec8dd7225164eb8c0884aa463654ef3fc
DIFF: https://github.com/llvm/llvm-project/commit/b28ed9cec8dd7225164eb8c0884aa463654ef3fc.diff

LOG: [clang-format] cleanup from D75517

Summary:
Fix typo in comment.

Add closing brace to test text.

Reviewers: krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D75856

Added: 
    

Modified: 
    clang/lib/Format/TokenAnnotator.cpp
    clang/unittests/Format/FormatTestCSharp.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 2673dacfff13..db230583b6c9 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -373,7 +373,7 @@ class AnnotatingParser {
     if (Tok.Previous && Tok.Previous->is(tok::identifier))
       return false;
 
-    // Chains [] in of `identifier[i][j][k]` are not attributes.
+    // Chains of [] in `identifier[i][j][k]` are not attributes.
     if (Tok.Previous && Tok.Previous->is(tok::r_square)) {
       auto *MatchingParen = Tok.Previous->MatchingParen;
       if (!MatchingParen || MatchingParen->is(TT_ArraySubscriptLSquare))

diff  --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp
index 7e60fdbdba26..e3038898dcdd 100644
--- a/clang/unittests/Format/FormatTestCSharp.cpp
+++ b/clang/unittests/Format/FormatTestCSharp.cpp
@@ -650,8 +650,15 @@ TEST_F(FormatTestCSharp, CSharpArraySubscripts) {
   FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
 
   // Do not format array subscript operators as attributes.
-  verifyFormat(R"(if (someThings[index].Contains(myThing)) {)", Style);
-  verifyFormat(R"(if (someThings[i][j][k].Contains(myThing)) {)", Style);
+  verifyFormat(R"(//
+if (someThings[index].Contains(myThing)) {
+})",
+               Style);
+
+  verifyFormat(R"(//
+if (someThings[i][j][k].Contains(myThing)) {
+})",
+               Style);
 }
 
 } // namespace format


        


More information about the cfe-commits mailing list