Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5312

Wrong line/col info for MapEntryExpressions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser-antlr
    • Labels:
      None

      Description

      Whenever there's a map entry, a named parameter, etc, a MapEntryExpression is used, but the line / col of MapEntryExpression is just surrounding the column, instead of the whole key + colon + value.

      Another problem with MEE is that the value goes up to the next comma or closing square bracket (including all potential whitespace), instead of just stopping at the end of the expression or constant.

        Issue Links

          Activity

          Hide
          Guillaume Guillaume Delcroix added a comment -

          LineColumnCheck possible test:

          ###mapEntryExpression:::
          foo ( a : 1 , b : 3,   c:   4   )
          :::[MapEntryExpression,(1:7),(1:12)][ConstantExpression,(1:7),(1:8)][ConstantExpression,(1:11),(1:12)];
          [MapEntryExpression,(1:15),(1:20)][ConstantExpression,(1:15),(1:16)][ConstantExpression,(1:19),(1:20)];
          [MapEntryExpression,(1:24),(1:30)][ConstantExpression,(1:24),(1:25)][ConstantExpression,(1:29),(1:30)]
          
          Show
          Guillaume Guillaume Delcroix added a comment - LineColumnCheck possible test: ###mapEntryExpression::: foo ( a : 1 , b : 3, c: 4 ) :::[MapEntryExpression,(1:7),(1:12)][ConstantExpression,(1:7),(1:8)][ConstantExpression,(1:11),(1:12)]; [MapEntryExpression,(1:15),(1:20)][ConstantExpression,(1:15),(1:16)][ConstantExpression,(1:19),(1:20)]; [MapEntryExpression,(1:24),(1:30)][ConstantExpression,(1:24),(1:25)][ConstantExpression,(1:29),(1:30)]
          Hide
          daniel_sun Daniel Sun added a comment -

          Fixed in the parrot branch

          Show
          daniel_sun Daniel Sun added a comment - Fixed in the parrot branch

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              Guillaume Guillaume Delcroix
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development