Here are notes on a medium-sized commit by jrose to clean up groovy.g.
Affected source files:
Functional changes
- Uniformly turn supply the method name "call" to method calls lacking an explicit method name. So,
foo(1)(2) is equivalent to foo(1).call(2).
- Allow non-braced body statements on 'while' (plugin bug).
- For compatibility, allow Java 5
for (T x : y) with a warning.
- For compatibility, allow Java 5
assert x : y.
- Put
strictContextExpression more places for consistency.
- Repair newline-suppression logic. Experimentally allow backslash '\' to force a newline to be insignificant outside of strings as well as inside.
- Experimental: Tune newline-spanning logic (for
f \n {g}) to be more selectively context-sensitive. (Affects pathExpression.)
(Newline spanning is performed in a simple path expression or in the RHS of an assignment, but not within the subparts of a more complex expression. For example, it is not performed when parsing the arguments of a command. This rule is experimental and probably needs to be even more restrictive.)
- Add mechanism to detect if an AST is simply a
pathExpression.
- Add mechanism to detect if an AST is a prefix of an
expressionStatement.
The inherited expression attribute lc_stmt tells if the left-context of an expression is a statement boundary or initializer.
Cleanups
- Remove usless rule
initializer.
- Remove excessive lookahead in
expressionStatement.
- Get rid of (harmless) ANTLR warning.