jashkenas/coffee-script — pull request #2930 by marchaefner (2013-04-15 19:51:07+00:00)
Title: Fixes #1057: Allow catch/finally in single line functions.

* Don't end single-line functions at `catch` or `finally`.

Implicit in/outdentation before those keywords is already inserted for a preceding `TRY` or `THEN` token.

A `catch` or `finally` in a single-line expression that is not preceded by a `try` or `catch ... then` is always (and should be) a syntax error. (See Example 3)

Some cleanup:

* Removed testing whether `IF` started a single-line expression (it never does).
* Removed `IMPLICIT_BLOCK` (was used in `addImplicitParentheses` which was removed by 1666716c3168f70e9eb6c997e0fff5f2b7815fc0)

---

Examples:

1. Illegal before, possible after this fix:
```coffeescript
x = -> try do f finally do cleanup
```

2. Possible before and after:
```coffeescript
x = try f -> catch err then -> finally do cleanup
```

3. Illegal before and after:
```coffeescript
try f
cb: -> finally do cleanup
```