[PATCH] D65012: Adds support for formatting NS_CLOSED_ENUM alongside NS_ENUM.

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 19 14:53:24 PDT 2019


benhamilton requested changes to this revision.
benhamilton added a comment.
This revision now requires changes to proceed.

Thanks! Don't forget the CF version.



================
Comment at: clang/lib/Format/FormatToken.h:793
   IdentifierInfo *kw_CF_OPTIONS;
+  IdentifierInfo *kw_NS_CLOSED_ENUM;
   IdentifierInfo *kw_NS_ENUM;
----------------
We'll also need `CF_CLOSED_ENUM`.



================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1219
+                             Keywords.kw_CF_ENUM, Keywords.kw_CF_OPTIONS,
+                             Keywords.kw_NS_CLOSED_ENUM))
         parseEnum();
----------------
`Keywords.CF_CLOSED_ENUM` here as well.



================
Comment at: clang/unittests/Format/FormatTest.cpp:1717-1736
 TEST_F(FormatTest, FormatsNSEnums) {
   verifyGoogleFormat("typedef NS_ENUM(NSInteger, SomeName) { AAA, BBB }");
+  verifyGoogleFormat(
+      "typedef NS_CLOSED_ENUM(NSInteger, SomeName) { AAA, BBB }");
   verifyGoogleFormat("typedef NS_ENUM(NSInteger, MyType) {\n"
                      "  // Information about someDecentlyLongValue.\n"
                      "  someDecentlyLongValue,\n"
----------------
Please also add a test for `CF_CLOSED_ENUM`.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65012/new/

https://reviews.llvm.org/D65012





More information about the cfe-commits mailing list