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

Nico Weber thakis at chromium.org
Mon Jan 7 11:13:10 PST 2013


On Mon, Jan 7, 2013 at 10:57 AM, Manuel Klimek <klimek at google.com> wrote:
> 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

r171766, thanks!

>
> Cheers,
> /Manuel
>
>>
>>
>> Nico
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>



More information about the cfe-commits mailing list