Hi,

This patch allows trailing commas in protocol lists. This is useful
when conditionally conforming to protocols. For example:

    @inteface MyView : UIView <
      UITableViewDelegate,
    #ifdef IN_APP_EXTENSION
      UIGestureRecognizerDelegate,
    #endif
    #ifdef OPTIONAL_FEATURE
      UITextFieldDelegate,
    #endif
    >

    @end

Without this patch, there's no clean way to write that because the
protocol list is not allowed to have a trailing comma. (You could use
JavaScript-style leading commas, but that’s not common in C-based
languages.) With this patch, the trailing comma is simply ignored. It’s
similar to how it’s ignored in Objective-C array and dictionary literals.

Attachment: protocols.patch
Description: protocols.patch

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to