You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/09/15 14:43:10 UTC
groovy git commit: Allow declaring tuple without `def` keyword
Repository: groovy
Updated Branches:
refs/heads/master 4045c614c -> a2fe3a5fd
Allow declaring tuple without `def` keyword
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a2fe3a5f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a2fe3a5f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a2fe3a5f
Branch: refs/heads/master
Commit: a2fe3a5fdf8d756681720d773f53fefaba8da26d
Parents: 4045c61
Author: sunlan <su...@apache.org>
Authored: Fri Sep 15 22:42:57 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Fri Sep 15 22:42:57 2017 +0800
----------------------------------------------------------------------
.../src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java | 2 ++
.../groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/a2fe3a5f/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 3815ee8..2f538fa 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
@@ -1499,9 +1499,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
}
private DeclarationListStatement createMultiAssignmentDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager) {
+ /*
if (!modifierManager.contains(DEF)) {
throw createParsingFailedException("keyword def is required to declare tuple, e.g. def (int a, int b) = [1, 2]", ctx);
}
+ */
return configureAST(
new DeclarationListStatement(
http://git-wip-us.apache.org/repos/asf/groovy/blob/a2fe3a5f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
index bb4aeac..f603e4b 100644
--- a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
@@ -54,7 +54,7 @@ class SyntaxErrorTest extends GroovyTestCase {
}
void "test groovy core - LocalVariableDeclaration"() {
- TestUtils.shouldFail('fail/LocalVariableDeclaration_01.groovy');
+// TestUtils.shouldFail('fail/LocalVariableDeclaration_01.groovy');
}
void "test groovy core - Continue"() {