bengardner/uncrustify — pull request #207 by idpaterson (2013-10-15 15:12:56+00:00)
Title: Added support for NS_ENUM and NS_OPTIONS modern Obj-C enums

This change allows standard enum formatting rules to be applied to `NS_ENUM` and `NS_OPTIONS`. The existing `ns_enum.m` test has been updated to include formatting of multiline enumerations. This should fix #143 as well as #201.

Regarding the implementation, I was hoping to avoid adding `CT_OC_NS_ENUM` as an alternate for `CT_ENUM` throughout the formatting code, but that did not quite work out. I would be glad to amend the pull request if you have any advice on how to better handle that!

`NS_OPTIONS` and `NS_ENUM` have the same syntax, just a different semantic meaning. For that reason, the paren group following those identifiers is given the parent type `CT_OC_NS_ENUM` regardless of whether the parent was `NS_ENUM` or `NS_OPTIONS`. I considered mapping both keywords and the parent of the paren group and braces over to `CT_ENUM` but was unsure whether that would have negative consequences on constructs in other languages. I think it could be more maintainable if you have a suggestion for how to handle that.

This does not provide any new formatting options for Obj-C enums. The paren group is marked as `OC_FPAREN_*` since it follows that syntax, so it should currently be formatted according to function param formatting rules.