This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 994c0b1 Trivial refactoring: remove duplicated code
994c0b1 is described below
commit 994c0b15792fef057ba26ede0ab3cc13c5851fd5
Author: Daniel Sun <[email protected]>
AuthorDate: Fri Jun 26 11:51:56 2020 +0800
Trivial refactoring: remove duplicated code
---
.../java/org/apache/groovy/parser/antlr4/AstBuilder.java | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 6ce6000..e3f2f29 100644
---
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -2472,20 +2472,13 @@ public class AstBuilder extends
GroovyParserBaseVisitor<Object> {
}
// e.g. m { return 1; }
- Expression thisExpr = new VariableExpression("this");
- configureAST(thisExpr, baseExpr);
-
MethodCallExpression methodCallExpression =
- new MethodCallExpression(
- thisExpr,
-
- (baseExpr instanceof VariableExpression)
- ? this.createConstantExpression(baseExpr)
- : baseExpr,
-
+ createMethodCallExpression(
+ baseExpr,
configureAST(
new
ArgumentListExpression(closureExpression),
- closureExpression)
+ closureExpression
+ )
);
return configureAST(methodCallExpression, ctx);