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 2020/12/16 00:10:48 UTC
[groovy] branch GROOVY-9859 updated (12d5cc7 -> 15dec05)
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a change to branch GROOVY-9859
in repository https://gitbox.apache.org/repos/asf/groovy.git.
discard 12d5cc7 GROOVY-9859: Groovy3 doesn't parse a function property when there's a new line between return value and function name
new 15dec05 GROOVY-9859: Groovy3 doesn't parse a function property when there's a new line between return value and function name
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (12d5cc7)
\
N -- N -- N refs/heads/GROOVY-9859 (15dec05)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/test/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[groovy] 01/01: GROOVY-9859: Groovy3 doesn't parse a function
property when there's a new line between return value and function name
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY-9859
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 15dec055d156e4d6163519f792f95356a54d2b7f
Author: Daniel Sun <su...@apache.org>
AuthorDate: Wed Dec 16 07:54:59 2020 +0800
GROOVY-9859: Groovy3 doesn't parse a function property when there's a new line between return value and function name
---
src/antlr/GroovyParser.g4 | 2 +-
src/test-resources/bugs/BUG-GROOVY-9859.groovy | 29 ++++++++++++++++++++++
.../groovy/parser/antlr4/GroovyParserTest.groovy | 2 ++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index e6b5f7b..418778c 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -267,7 +267,7 @@ memberDeclaration[int t]
* ct 9: script, other see the comment of classDeclaration
*/
methodDeclaration[int t, int ct]
- : modifiersOpt typeParameters? returnType[$ct]?
+ : modifiersOpt typeParameters? (returnType[$ct] nls)?
methodName formalParameters
(
DEFAULT nls elementValue
diff --git a/src/test-resources/bugs/BUG-GROOVY-9859.groovy b/src/test-resources/bugs/BUG-GROOVY-9859.groovy
new file mode 100644
index 0000000..18310ca
--- /dev/null
+++ b/src/test-resources/bugs/BUG-GROOVY-9859.groovy
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public synchronized ImmutableMap<String,Pair<String,Double>>
+a(
+ List<String> params,
+ List<String> columnMapping)
+{
+ return null;
+}
+
+public class Pair<T, U> {}
+public class ImmutableMap<T, U> {}
diff --git a/src/test/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/src/test/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 0ef457a..6babb90 100644
--- a/src/test/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/src/test/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -22,6 +22,7 @@ import groovy.test.GroovyTestCase
import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
import org.codehaus.groovy.ast.ClassNode
import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.GenericsType
import org.codehaus.groovy.ast.MethodNode
import org.codehaus.groovy.ast.Parameter
import org.codehaus.groovy.ast.PropertyNode
@@ -439,6 +440,7 @@ final class GroovyParserTest extends GroovyTestCase {
doTest('bugs/BUG-GROOVY-8913.groovy')
doRunAndTestAntlr4('bugs/BUG-GROOVY-8991.groovy')
doTest('bugs/BUG-GROOVY-9399.groovy')
+ doTest('bugs/BUG-GROOVY-9859.groovy', [GenericsType])
}
void "test groovy core - GROOVY-9427"() {