bengardner/uncrustify — pull request #233 by JoshuaGross (2014-01-21 00:36:57+00:00)
Title: Improve block support for Objective-C

* More indenting options for Objective-C blocks, and passing blocks as method invocation parameters.
* Fix `for...in` for Objective-C.
* Allow methods to be invoked on Objective-C primitives, like NSStrings.
* Unit tests for the above.

Resolves #210 and #209.

@bengardner I may have missed some indentation issues, though I did do a scrub for it. Do you have an Uncrustify cfg for this repo? :)

----

Summary of squashed individual commits, for History:

* Fix case of block literal being mistaken for block signature.
* Adding another test case for situations where extra space is added around a block passed in as the first argument of a C method invocation.
* Adding the cfg file for our new tests.
* Fix case where a block is passed as the first argument of a C-style method invocation; the parser marked the whole thing as a block type definition.
* Add another test for short ternary expressions and make sure it takes precedence over question mark spacing.
* Strengthening tests to make sure that short ternary doesn't break regular ternary expressions.
* Test showing how Uncrustify fails to treat messages on string literals properly.
* Allow messages to be sent to NSStrings.
* Add tests that show that casting to (id) breaks parsing (meaningless operation but syntactically valid).
* Allow `(id)[obj args]` as a valid Objective-C casting statement.
* Fix test case expected output.
* Fix for (x in y) for objective-c
* Improving indentation support of blocks being passed into message invocations.
* New options for indenting blocks in message invocations in different ways.
* Fix the block indentation options for Objective-C; it was very aggressively indenting more than was necessary.
* Mimic Objective-C style inline-block indentation.
* Prioritize aligning everything with the first message in a message invocation, if possible (as long as it doesn't force us to go below the current indentation level, we're fine).
* Xcode-style block-in-message indenting.
* Fix segfault
* Put parens around bitwise op
* Fix indentation
* Move check for for...in loops in Objective-C to a helper function in chunk_list.h
* Adding small test-case for for...in loops with id type declarations.