groovy (moved to ASF)
  1. groovy (moved to ASF)
  2. GROOVY-5312

Wrong line/col info for MapEntryExpressions

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Component/s: parser-antlr
    • Labels:
      None
    • Number of attachments :
      0

      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 Laforge 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 Laforge 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)]

            People

            • Assignee:
              Unassigned
              Reporter:
              Guillaume Laforge

              Dates

              • Created:
                Updated: