Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-beta-1
-
None
-
WinXP
-
Patch
Description
This patch corrects the source position information in the following situations:
- MethodCallExpression
- includes the callee and an appendedBlock (if there is one) to the method call
- solved in grammar
- StaticMethodCallExpression
- set the source position for StaticMethodCallExprssion when it is created
- Solved in StaticImportVisitor
- indexPropertyArgs
- set the source postion in terms like obj['prop'] correct
- include the indexee if there is one
- solved in grammar
- ConstructorCallExpression
- ConstructorCallExpression includes now whole expression with the type, not only the 'new' operator
- solved in grammar
- declaratorBrackets
- DeclarationExpression like int[][][] array did only include the variable
- now the whole expression
- solved in grammar
- transfomed DeclarationExpression
- a declaration that contains a class like def i = Integer.parseInt("42") had -1 as source position information
- solved in ResolveVisitor: Set the source position of the unresolved expression to the resolved DeclarationExpression
- new create method for node creation
- new create method of signature: public AST create(int type, String txt, AST first, Token last)
- parameter 'first' is of type AST therefore a node can be used to set the start position
- used in the patches above: MethodCallExpression, indexPropertyArgs
The test patch contains tests for the test environment described in GROOVY-259.
Due to the ConstructorCallExpression change, one test of GROOVY-2615 needed to be adapted. This is also patched with the test patch.