[cfe-commits] Patch to format an ObjC method declaration.

Jordan Rose jordan_rose at apple.com
Sat Dec 8 17:41:08 PST 2012


The usual Objective-C format (drawing from our headers) doesn't look like that at all. Is this just to have a base to work off of?

Here's a made-up method showing the canonical spacing in our headers:

> - (NSInteger)countOfObjectsInArray:(NSArray *)array matchingCondition:(NSPredicate *)pred;


Also, there should be a test case for 0, 1, and 2 parameters at least -- if it completely mangles any of those, we're in trouble.

Other test cases to consider (eventually): selectors with "empty" pieces, missing return type (implied id), missing argument types (implied id).

Obviously the "lining up colons" thing will be a much trickier bit of work that can go in later. If this is just to get things started, can we have a FIXME next to the current, incorrectly-formatted EXPECT_EQ?

Jordan


On Dec 8, 2012, at 14:27 , Fariborz Jahanian <fjahanian at apple.com> wrote:

> This is an attempt to format an objective-C method declaration using the new clang formatter.
> Please review.
> 
> <format-objc-patch.txt>
> 
> - Thanks, Fariborz
> 
> _______________________________________________
> 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