groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [2/2] groovy git commit: Represent built-in type with `VariableExpression`
Date Sat, 17 Feb 2018 20:34:22 GMT
Represent built-in type with `VariableExpression`


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/709c0d94
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/709c0d94
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/709c0d94

Branch: refs/heads/master
Commit: 709c0d94208f0f31187a4c5ea810565aaab9ad4a
Parents: ec6b6de
Author: danielsun1106 <realbluesun@hotmail.com>
Authored: Sun Feb 18 04:00:09 2018 +0800
Committer: danielsun1106 <realbluesun@hotmail.com>
Committed: Sun Feb 18 04:30:12 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/groovy/parser/antlr4/AstBuilder.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/709c0d94/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
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 f1f256e..e3c87eb 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
@@ -2348,7 +2348,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
                 return configureAST(methodCallExpression, ctx);
             }
 
-            if (baseExpr instanceof ClassExpression) { // void and primitive type AST node
must be an instance of ClassExpression
+            if (baseExpr instanceof VariableExpression) { // void and primitive type AST
node must be an instance of VariableExpression
                 String baseExprText = baseExpr.getText();
                 if (VOID_STR.equals(baseExprText)) { // e.g. void()
                     return configureAST(createCallMethodCallExpression(this.createConstantExpression(baseExpr),
argumentsExpr), ctx);
@@ -3122,7 +3122,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
     }
 
     @Override
-    public ClassExpression visitBuiltInTypePrmrAlt(BuiltInTypePrmrAltContext ctx) {
+    public VariableExpression visitBuiltInTypePrmrAlt(BuiltInTypePrmrAltContext ctx) {
         return configureAST(this.visitBuiltInType(ctx.builtInType()), ctx);
     }
 
@@ -3366,7 +3366,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
     */
 
     @Override
-    public ClassExpression visitBuiltInType(BuiltInTypeContext ctx) {
+    public VariableExpression visitBuiltInType(BuiltInTypeContext ctx) {
         String text;
         if (asBoolean(ctx.VOID())) {
             text = ctx.VOID().getText();
@@ -3376,7 +3376,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
             throw createParsingFailedException("Unsupported built-in type: " + ctx, ctx);
         }
 
-        return configureAST(new ClassExpression(ClassHelper.make(text)), ctx);
+        return configureAST(new VariableExpression(text), ctx);
     }
 
 


Mime
View raw message