Here are notes on a medium-sized commit by jrose to clean up groovy.g.
Affected source files:
- groovy.g, rev 1.24: http://cvs.groovy.codehaus.org/viewrep/groovy/groovy/groovy-core/src/main/org/codehaus/groovy/antlr/groovy.g
- plugin, rev 1.32: http://cvs.groovy.codehaus.org/viewrep/groovy/groovy/groovy-core/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
Functional changes
- Uniformly turn supply the method name "call" to method calls lacking an explicit method name. So,
foo(1)(2)is equivalent tofoo(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
strictContextExpressionmore 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. (AffectspathExpression.)
(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 attributelc_stmttells 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.
Here are notes on a medium-sized commit by jrose to clean up groovy.g and associated files.
Affected source files:
- groovy.g, rev 1.17: http://cvs.groovy.codehaus.org/viewrep/groovy/groovy/groovy-core/src/main/org/codehaus/groovy/antlr/groovy.g
- plugin, rev 1.18: http://cvs.groovy.codehaus.org/viewrep/groovy/groovy/groovy-core/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
- Isolated token changes in a couple of test files (x..<y range syntax).
Functional changes
- Allow newline before
LBRACEuniformly. Use nlsWarn in all such cases. - Factor
T[]syntax into declaratorBrackets rule. - Make
newandMETHOD_CALLexpressions have common structure. - Add grammar for proposed
"$*x"GString syntax. - Right-exclusive ranges are spelled
x..<y(x...ytemporarily backward-compatible). - Fix bug in
#!comment syntax. - Clarify keywords in argList rule. Allow '
[:' only ingrammar notes.
Name changes
- SPREAD_ARG => SPREAD_DOT (for *. nodes)
- OPTIONAL_ARG => OPTIONAL_DOT (for ?. nodes)
- METHOD_POINTER => MEMBER_POINTER (for .& nodes)
Cleanups
- Remove transitional hack arrayOrTypeArgs.
- Clean up and simplify
pathExpressionandcommandStatementrules. - Add some more javadoc.
- Remove annoying
zz=decorations on argList, etc. - Remove useless rules for
expressionBlock,assignmentTail,assignmentOp. - Factor statement label syntax into
statementLabelPrefix. - Remove some useless 'greedy' declarations.
