Skip to content
Commit a7252d83 authored by Nico Weber's avatar Nico Weber
Browse files

Formatter: Initial support for formatting Objective-C method expressions.

                                                                                 
This follows the approach suggested by djasper in PR14911: When a '[' is         
seen that's at the start of a line, follows a binary operator, or follows one    
of : [ ( return throw, that '[' and its closing ']' are marked as
TT_ObjCMethodExpr and every ':' in that range that isn't part of a ternary
?: is marked as TT_ObjCMethodExpr as well.

Update the layout routines to not output spaces around ':' tokens that are
marked TT_ObjCMethodExpr, and only allow breaking after such tokens, not
before.

Before:
    [self adjustButton : closeButton_ ofKind : NSWindowCloseButton];

Now:
    [self adjustButton:closeButton_ ofKind:NSWindowCloseButton];

llvm-svn: 172304
parent eee7b81a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment