Skip to content
Permalink
Browse files
Revert "Groovy-10520: Capture correct line numbers for Closure/Block …
…statements."

This reverts commit e7feb3e.
  • Loading branch information
daniellansun committed Mar 8, 2022
1 parent e7feb3e commit 23879e88f542769f946f4529523a322162fced08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
@@ -499,7 +499,7 @@ lambdaBody

// CLOSURE
closure
: LBRACE (nls (formalParameterList nls)? ARROW)? blockStatementsOpt RBRACE
: LBRACE (nls (formalParameterList nls)? ARROW)? sep? blockStatementsOpt RBRACE
;

// GROOVY-8991: Difference in behaviour with closure and lambda
@@ -509,7 +509,7 @@ closureOrLambdaExpression
;

blockStatementsOpt
: sep? blockStatements?
: blockStatements?
;

blockStatements
@@ -560,7 +560,7 @@ elementValueArrayInitializer
// STATEMENTS / BLOCKS

block
: LBRACE blockStatementsOpt RBRACE
: LBRACE sep? blockStatementsOpt RBRACE
;

blockStatement
@@ -171,14 +171,6 @@ var = f{closure}
:::[MethodCallExpression,(1:7),(1:17)];
[ConstantExpression,(1:7),(1:8)][ArgumentListExpression,(1:8),(1:17)][ClosureExpression,(1:8),(1:17)]


###closureExpressionWithEmptyBlockStatement:::
f{

}
:::[MethodCallExpression,(1:1),(3:2)];
[ConstantExpression,(1:1),(1:2)][ArgumentListExpression,(1:2),(3:2)][ClosureExpression,(1:2),(3:2)][BlockStatement,(1:3),(3:1)]

###ArrayExpressionD1:::
def array = new int[1]
:::[ArrayExpression,(1:13),(1:23)][ClassNode,(1:17),(1:20)][ConstantExpression,(1:21),(1:22)]

0 comments on commit 23879e8

Please sign in to comment.