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/04/16 14:38:35 UTC

[groovy] branch GROOVY-9511 created (now 67a8cf4)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch GROOVY-9511
in repository https://gitbox.apache.org/repos/asf/groovy.git.


      at 67a8cf4  GROOVY-9511: Annotation spanning lines is not supported by Parrot

This branch includes the following new commits:

     new 67a8cf4  GROOVY-9511: Annotation spanning lines is not supported by Parrot

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.



[groovy] 01/01: GROOVY-9511: Annotation spanning lines is not supported by Parrot

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY-9511
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 67a8cf40ba36090127828361b4e089d8189b082f
Author: Daniel Sun <su...@apache.org>
AuthorDate: Thu Apr 16 22:38:16 2020 +0800

    GROOVY-9511: Annotation spanning lines is not supported by Parrot
---
 src/antlr/GroovyParser.g4                          |  2 +-
 .../groovy/parser/antlr4/GroovyParserTest.groovy   |  4 +++
 .../src/test/resources/bugs/BUG-GROOVY-9511.groovy | 42 ++++++++++++++++++++++
 3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index a126114..39c4186 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -509,7 +509,7 @@ annotationsOpt
     ;
 
 annotation
-    :   AT annotationName ( LPAREN elementValues? rparen)?
+    :   AT annotationName (nls LPAREN elementValues? rparen)?
     ;
 
 elementValues
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index aefac72..e81633c 100644
--- a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -454,4 +454,8 @@ final class GroovyParserTest extends GroovyTestCase {
     void "test groovy core - GROOVY-9449"() {
         doTest('bugs/BUG-GROOVY-9449.groovy');
     }
+
+    void "test groovy core - GROOVY-9511"() {
+        doTest('bugs/BUG-GROOVY-9511.groovy', [MethodNode]);
+    }
 }
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-9511.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-9511.groovy
new file mode 100644
index 0000000..6c1b4d2
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-9511.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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.
+ */
+
+@interface CollectionOfElements{}
+@interface JoinTable{
+    Table table()
+    JoinColumn[] joinColumns()
+}
+@interface Table{ String name() }
+@interface JoinColumn{ String name() }
+@interface Column{
+    String name()
+    boolean nullable()
+}
+
+class OtherSection {
+    @CollectionOfElements
+    @JoinTable
+            (
+                    table = @Table(name="gaga"),
+                    joinColumns = @JoinColumn(name="BoyId")
+            )
+    @Column(name="favoritepoupon",
+            nullable=false)
+    Set<String> questions = new HashSet<String> ()
+}