groovy

Patches for line / colum information for various AST Nodes

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6-beta-1
  • Fix Version/s: 1.5.6, 1.6-beta-1
  • Component/s: parser
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    4

Description

as announced before (groovy-eclipse mailinglist) we created some patches for the groovy core and the grammar. The changes affect line / column information of various AST nodes, we needed to fix these four our project where we're working on a refactoring feature for groovy-eclipse.

The changes are described in our report that is available on http://sifsstud4.hsr.ch/groovy-refactoring.pdf

description of the three patch files:

coreChanges.patch:

  • added method getOriginType() to the Interface "Variable.java" (Description in Chapter: 5.5.2.3 Primitive Types)
  • calling setReturnType(returnType) from c'tor in "MethodNode.java", extended this method (Description in Chapter: 5.5.2.5 Dynamic Return Types)
  • left expression col. infos where to long in declaration expression node (Description in Chapter: 5.5.2.1 Declaration)
  • initial expression col. infos were wrong in field node (Description in Chapter: 5.5.2.2 FieldNode)
  • Changed the collection in "AnnotatedNode.java" to a LinkedHashMap, this way we were able to write the annotations back in the order they we're written.

newTests.patch:

  • file contains new tests to test the getOriginType() method in the class VariableExpression
  • the 2nd testclass tests the DynamicReturnType information of methodNodes
  • adding tests to suite

grammarChanges.patch:

  • changes are described in Chapter: 5.5.1 Grammar Changes
  1. coreChanges.patch
    22/Feb/08 4:18 AM
    6 kB
    Reto Kleeb
  2. grammarChanges.patch
    22/Feb/08 4:18 AM
    18 kB
    Reto Kleeb
  3. newTests.patch
    22/Feb/08 4:18 AM
    6 kB
    Reto Kleeb
  4. testDatenGrammarPatch.patch
    19/Mar/08 8:22 AM
    5 kB
    Martin Kempf

Issue Links

Activity

Hide
Martin Kempf added a comment -

Test for the line/column information in the AST.
It is a testfile that needs the provided test environment from GROOVY-259

Show
Martin Kempf added a comment - Test for the line/column information in the AST. It is a testfile that needs the provided test environment from GROOVY-259

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: