[cfe-commits] [patch] Let formatting format objc access specifiers

Manuel Klimek klimek at google.com
Mon Jan 7 10:57:28 PST 2013


On Mon, Jan 7, 2013 at 6:55 PM, Nico Weber <thakis at chromium.org> wrote:

> Hi,
>
> the attached patch adds formatting support for the objc formatting
> specifiers @public, @protected, @private, and @package. @package is
> new in Objective-C 2, so the patch also turns on LangOpts.ObjC2 for
> the test.
>
> The patch formats them like public:, private:, and protected: in c++.
> This is definitely correct for google style, and `ack "@public"
> test/SemaObjC` suggests that it might be correct for non-google style
> too (but that can be tweaked later).
>
> Ok?
>

+  if (FormatTok.Tok.is(tok::at)) {
+    nextToken();
+    switch (FormatTok.Tok.getObjCKeywordID()) {
+    case tok::objc_public:
+    case tok::objc_protected:
+    case tok::objc_package:
+    case tok::objc_private:
+      return parseAccessSpecifier();
+    default:
+      break;
+    }
+  }

Please put this into a case tok::at in the switch below.

Apart from that lg

Cheers,
/Manuel


>
> Nico
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130107/0adf33ee/attachment.html>


More information about the cfe-commits mailing list