You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/05/08 00:27:04 UTC

[04/17] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
new file mode 100644
index 0000000..4bea111
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+@Export
+@Version
+package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
new file mode 100644
index 0000000..a3e7d8c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Export @Version
+package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
new file mode 100644
index 0000000..855b57f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+@Test1 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
new file mode 100644
index 0000000..b53f38d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Test1
+import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
new file mode 100644
index 0000000..bbb83e3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Test1 @Test2
+import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
new file mode 100644
index 0000000..7a2e4d0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
@@ -0,0 +1,28 @@
+/*
+ *  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.
+ */
+@Test1 @Test2 @Test3
+import java.util.Map
+@Test1 @Test2 @Test3
+import java.util.*
+@Test1 @Test2 @Test3
+import static java.lang.Math
+@Test1 @Test2 @Test3
+import static java.lang.Math.*
+@Test1 @Test2 @Test3
+import static java.lang.Math.pow

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
new file mode 100644
index 0000000..b5753c4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+@Test1(12)
+@Test1(@Test1)
+@Test2(v=6)
+@Test3(v1=6, v2=8, v3=10)
+@Test4([1, 2, 3])
+@Test5(v=[1, 2, 3])
+@Test6(v1=[1, 2, 3], v2=[1], v3=6)
+package core
+
+@Grapes([
+        @Grab('xx:yy:1.0'), // xx
+        @Grab('zz:yy:1.0') /* zz */
+])
+import xx.yy.ZZ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
new file mode 100644
index 0000000..1ee354b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+import java.lang.annotation.RetentionPolicy
+import java.lang.annotation.Retention
+
+def closureClass = NestedAnnotationWithDefault.getAnnotation(AnnWithNestedAnnWithDefault).elem().elem()
+def closure = closureClass.newInstance(null, null)
+assert closure.call() == 3
+
+
+@AnnWithNestedAnnWithDefault(elem = @AnnWithDefaultValue())
+class NestedAnnotationWithDefault {}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnWithDefaultValue {
+    Class elem() default { 1 + 2 }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnWithNestedAnnWithDefault {
+    AnnWithDefaultValue elem()
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
new file mode 100644
index 0000000..9af7957
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
@@ -0,0 +1,104 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+def testArrayInitializer() {
+    def x = new double[] {}
+    assert x.length == 0
+
+    def y = new double[][] {}
+    assert y.length == 0
+
+    def a = new int[] {1, 2}
+    assert a[0] == 1
+    assert a[1] == 2
+    assert a as List == [1, 2]
+
+    def b = new int[][] {
+        new int[] {1, 1.plus(1)},
+        new int[] {2.plus(1), 4}
+    }
+    assert b[0][0] == 1
+    assert b[0][1] == 2
+    assert b[1][0] == 3
+    assert b[1][1] == 4
+
+    def c = new String[] {
+        'a'
+        ,
+        'b'
+        ,
+        'c'
+        ,
+    }
+    assert c[0] == 'a'
+    assert c[1] == 'b'
+    assert c[2] == 'c'
+
+    assert new String[]
+            {
+                'a', 'b'
+            }
+    ==
+            ['a', 'b'] as String[]
+}
+testArrayInitializer();
+
+@CompileStatic
+def testArrayInitializerCS() {
+    def x = new double[] {}
+    assert x.length == 0
+
+    def y = new double[][] {}
+    assert y.length == 0
+
+    def a = new int[] {1, 2}
+    assert a[0] == 1
+    assert a[1] == 2
+    assert a as List == [1, 2]
+
+    def b = new int[][] {
+        new int[] {1, 1.plus(1)},
+        new int[] {2.plus(1), 4}
+    }
+    assert b[0][0] == 1
+    assert b[0][1] == 2
+    assert b[1][0] == 3
+    assert b[1][1] == 4
+
+    def c = new String[] {
+        'a'
+        ,
+        'b'
+        ,
+        'c'
+        ,
+    }
+    assert c[0] == 'a'
+    assert c[1] == 'b'
+    assert c[2] == 'c'
+
+    assert new String[]
+            {
+                'a', 'b'
+            }
+    ==
+    ['a', 'b'] as String[]
+}
+testArrayInitializerCS();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
new file mode 100644
index 0000000..f790083
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+assert true
+assert true;
+assert true : ':(';
+assert true , ':(';
+assert true :
+        ':('
+assert true ,
+        ':(';
+
+assert true:    \
+    'hello, world'
+
+assert true,    \
+    'hello, world'
+
+assert 1 \
+        + 2 * \
+        3 :    \
+        'hello, world'
+
+assert 1 \
+        + 2 * \
+\
+        3 :    \
+\
+\
+'hello, world'
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
new file mode 100644
index 0000000..659232d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
@@ -0,0 +1,55 @@
+/*
+ *  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.
+ */
+import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
+
+testBinaryExpression()
+
+/***********************************/
+void testBinaryExpression() {
+    isRendered """
+assert a * b
+       | | |
+       0 0 1
+        """, {
+        def a = 0
+        def b = 1
+        assert a * b
+    }
+
+    isRendered """
+assert a[b]
+       |||
+       ||0
+       |false
+       [false]
+        """, {
+        def a = [false]
+        def b = 0
+        assert a[b]
+    }
+}
+
+static isRendered(String expectedRendering, Closure failingAssertion) {
+    try {
+        failingAssertion.call();
+        assert false, "assertion should have failed but didn't"
+    } catch (PowerAssertionError e) {
+        assert expectedRendering.trim() == e.message.trim()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
new file mode 100644
index 0000000..71f4540
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
@@ -0,0 +1,44 @@
+/*
+ *  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.
+ */
+import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
+
+testPostfixExpression()
+
+/***********************************/
+
+void testPostfixExpression() {
+    isRendered """
+assert x++ == null
+       ||  |
+       |0  false
+       0
+        """, {
+        def x = 0
+        assert x++ == null
+    }
+}
+
+static isRendered(String expectedRendering, Closure failingAssertion) {
+    try {
+        failingAssertion.call();
+        assert false, "assertion should have failed but didn't"
+    } catch (PowerAssertionError e) {
+        assert expectedRendering.trim() == e.message.trim()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
new file mode 100644
index 0000000..33bb86d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.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.
+ */
+package core
+
+class a<T> {
+    int x = 1;
+}
+
+a b = new a()
+assert b.x == 1
+
+a<String> b2 = new a<String>()
+assert b2.x == 1
+
+a<String>[] b3 = new a<String>[0]
+assert b3.length == 0
+
+core.a b4 = new a()
+assert b4.x == 1
+
+core.a<String> b5 = new a<String>()
+assert b5.x == 1
+
+core.a<String>[] b6 = new a<String>[0]
+assert b6.length == 0
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
new file mode 100644
index 0000000..3c38453
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+package core
+
+import java.util.concurrent.atomic.AtomicInteger
+
+def inc(AtomicInteger x) { x.incrementAndGet() }
+def a = new AtomicInteger(0)
+
+inc a
+assert 1 == a.get()

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
new file mode 100644
index 0000000..4f9e8d7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+package core
+
+class a {}
+a[] b
+b = new a[0]
+assert 0 == b.length
+
+a[] b2 = new a[0]
+assert 0 == b2.length
+
+core.a[] b3
+b3 = new a[0]
+assert 0 == b3.length
+
+core.a[] b4 = new a[0]
+assert 0 == b4.length
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
new file mode 100644
index 0000000..477932b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
@@ -0,0 +1,44 @@
+/*
+ *  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.
+ */
+package core
+
+class B<T> {}
+B b
+b = new B()
+assert b instanceof B
+
+B<String> b2
+b2 = new B<String>()
+assert b2 instanceof B
+
+B<String>[] b3
+b3 = new B<String>[0]
+assert b3 instanceof B[]
+
+core.B b4
+b4 = new B()
+assert b4 instanceof B
+
+core.B<String> b5
+b5 = new B<String>()
+assert b5 instanceof B
+
+core.B<String>[] b6
+b6 = new B<String>[0]
+assert b6 instanceof B[]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
new file mode 100644
index 0000000..05c8bc3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+package core
+
+class A {}
+class B<T> {}
+class C<T extends A> {}
+class D<T extends A & B> {}
+class E<T extends A & B & C> {}
+class F<T extends A & B & C> extends A {}
+class F2 extends A<T> {}
+class G1<T extends A & B & C> extends A implements X {}
+class G2<T extends A & B & C> extends A<T> implements X<T> {}
+class G3                      extends A<T> implements X<T> {}
+class G4                      extends A    implements X<T> {}
+class G5                      extends A    implements X    {}
+class H<T extends A & B & C> extends A implements X, Y {}
+class I<T extends A & B & C> extends A implements X, Y, Z {}
+public class J<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 public class K<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 @Test3 public class L<T extends A & B & C> extends A implements X, Y, Z {}
+
+@Test2
+@Test3
+@Test4(value={
+        def a = someMethod()
+        assert a.result() == 'abc'
+})
+@Test5(b=2, a=1)
+@Test6(a=2, b=1)
+public
+class M
+<
+        T extends
+A &
+B &
+C
+>
+        extends
+                A
+        implements
+                X,
+                Y,
+                Z
+{
+
+}
+
+class a {}
+
+class OutputTransforms {
+        final  static localTransforms = loadOutputTransforms()
+}
+
+class OutputTransforms2 {
+        @Lazy  static localTransforms = loadOutputTransforms()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
new file mode 100644
index 0000000..a973737
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
@@ -0,0 +1,60 @@
+/*
+ *  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.
+ */
+class AA {
+    {
+        println 123
+    }
+}
+
+class BB {
+    static {
+        println '123'
+    }
+}
+
+class CC {
+    static
+    {
+        println '123'
+    }
+}
+
+class DD {
+    static {
+        println '123'
+    }
+
+    {
+        println 'abc'
+    }
+
+    static {
+        println '234'
+    }
+
+    {
+        println 'bcd'
+    }
+}
+
+class EE {{}}
+class FF {static {}}
+class GG {static {};{}}
+
+class Iterator implements java.util.Iterator {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
new file mode 100644
index 0000000..70ad9a0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
@@ -0,0 +1,69 @@
+/*
+ *  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.
+ */
+import java.sql.SQLException
+
+class AAA {
+    private volatile XX xx;
+    private transient YY yy;
+
+    public AAA() {
+
+    }
+
+    public AAA(String name) {
+
+    }
+
+    @Test2
+    public AAA(String name, int age) throws Exception {
+
+    }
+
+    AAA(String name, int age, String title) throws Exception {
+
+    }
+
+    private AAA(String name, int age, String title, double income) throws Exception {
+
+    }
+
+    @Test2
+    public synchronized String sayHello(String name) {
+        return "Hello, $name";
+    }
+
+    @Test2
+    public <T> T sayHello2(T name) throws IOException, SQLException {
+        return "Hello, $name";
+    }
+
+    public static privateStaticMethod(){}
+
+    public void m(final int param) {}
+    public void m2(def param) {}
+    public void m3(final int param1, long param2, final String param3) {}
+
+    def "hello world"(p1, p2) {
+        println "$p1, $p2"
+    }
+
+    def run() {
+        this."hello world"('ab', 'bc')
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
new file mode 100644
index 0000000..78230e8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
@@ -0,0 +1,40 @@
+/*
+ *  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 class Person {
+    public static final SOME_CONSTANT = 'SOME_CONSTANT';
+    private String name = 'Daniel';
+    private int age;
+    @Test2
+    private String country = 'China',
+            location = 'Shanghai';
+
+    private String field, field2 = 'field2';
+    String someProperty;
+    String someProperty2 = 'someProperty2';
+    String someProperty3 = 'someProperty3',
+            someProperty4 = 'someProperty4';
+    String someProperty5, someProperty6 = 'someProperty6';
+    final String someProperty7 = 'someProperty7';
+    static final String someProperty8 = 'someProperty8';
+
+    @Test3
+    static final String someProperty9 = 'someProperty9';
+
+    protected static def protectedStaticDefField;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
new file mode 100644
index 0000000..25c3701
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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 class A extends B {
+    private int age;
+
+    public A() {
+        super()
+    }
+
+    public A(int age) {
+        this()
+    }
+
+    public A(String name) {
+        super(name);
+    }
+
+    public A(String name, int age) {
+        this(name);
+        this.age = age;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
new file mode 100644
index 0000000..34a9c2a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
@@ -0,0 +1,101 @@
+/*
+ *  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 class OuterA {
+    class InnerB {}
+}
+
+class OuterClazz {
+    enum InnerEnum implements SomeInterface {
+        A, B
+    }
+}
+
+
+class AA {
+    class Inner {
+        public def innerMethod() {}
+    }
+    private class PrivateInner {}
+    protected final class ProtectedFinalInner {
+        ProtectedFinalInner() {
+
+        }
+
+        ProtectedFinalInner(Integer a) {
+            new A() {
+                public int method() {
+                    1
+                }
+            }
+        }
+    }
+
+    public int method() {
+        0
+    }
+}
+
+
+
+interface A {
+    static enum B {
+        static interface C {
+        }
+    }
+}
+
+interface A2 {
+    static class B2 {
+        static enum C2 {
+        }
+    }
+}
+
+enum A4 {
+    static interface B4 {
+        static class C4 {
+        }
+    }
+}
+
+
+class A3 {
+    static class B3 {
+        static enum C3 {
+        }
+    }
+}
+
+class A5 {
+    static class B5 {
+        static class C5 {
+        }
+    }
+}
+
+interface A1 {
+    static interface B1 {
+        static enum C1 {
+        }
+    }
+}
+
+
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
new file mode 100644
index 0000000..4406289
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
@@ -0,0 +1,45 @@
+/*
+ *  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.
+ */
+new A() {}
+new A(1, '2') {
+    public void prt() {
+        new B() {}
+        new C() {
+            {
+                new D() {
+                    {
+                        new E() {}
+                        new F() {}
+                    }
+                }
+            }
+        }
+    }
+}
+
+class OuterAA {
+    public void method() {
+        new InnerBB() {}
+        new InnerCC() {{
+            new InnerDD() {}
+            new InnerEE() {}
+        }}
+        new InnerFF() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
new file mode 100644
index 0000000..ba93142
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{->}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
new file mode 100644
index 0000000..92fdd1c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{->12}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
new file mode 100644
index 0000000..3e91329
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{-> {->12}}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
new file mode 100644
index 0000000..25e391b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{->
+    12
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
new file mode 100644
index 0000000..3223365
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{int a ->
+    a
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
new file mode 100644
index 0000000..5c7062b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+{int a,
+ long b, float[] c,
+ double[][] d, String e, Object[] f,
+ Object[][] g, Object[][][] h,
+ Object[]... i
+    ->
+
+    a
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
new file mode 100644
index 0000000..c6f6c9f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{Object... i ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
new file mode 100644
index 0000000..9a98f35
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+{ List<String> i, List<List<String>> j, List<List<List<String>>> k,
+  List<?> l, List<? extends Map> m, List<? super Map> n,
+  List<? extends Map<String, Object>> o, List<? super Map<String, Object>> p,
+  List<String>[] q,  List<? extends Map<String, Object>>[][] r,
+
+  List<
+        ? super
+                Map,
+        ? extends
+        Set,
+        List
+        > s,
+
+  List<? extends Map<String, Object>>[][]... t ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
new file mode 100644
index 0000000..919a8a9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+{ String i,
+  final String j, final def String k,
+  @Test2 final def String l,
+  @Test2
+  final
+
+  def
+          String m,
+        final n,
+        def
+          o,
+        p, q,
+        r, s,
+  @Test2 final def String... z ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
new file mode 100644
index 0000000..024b334
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+{ java.lang.Integer t, Integer u, int v, int[] w, int[][] x,
+    String y = 'y', long... z = 123 ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
new file mode 100644
index 0000000..d9dd10d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.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.
+ */
+def m() {
+    int result = 0;
+    {
+        int i = 1;
+        result += i;
+    }
+    {
+        int i = 2;
+        result += i;
+
+        {
+            int j = 3;
+            result += j;
+        }
+        {
+            int j = 4;
+            result += j;
+        }
+
+    }
+    return { result }
+}
+
+assert m()() == 10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
new file mode 100644
index 0000000..beadc8a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
@@ -0,0 +1,36 @@
+/*
+ *  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.
+ */
+a 1
+a 1, 2
+a x: 1, y: 2
+a.b 1, 2
+z.a b(1), c(2)
+a.b x: 1, y: 2
+z.a x: b(1), y: c(2)
+a b(1), c(2)
+a x: b(1), y: c(2)
+z.a x: b(1, 3), y: c(2, 4)
+a b(1, 3), c(2, 4)
+obj.<Integer, Double>a b(1, 3), c(2, 4), d(3, 5)
+println a
+// println a = 1  // breaking change
+println a == 1
+
+result.addAll allElements()
+task someTask() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy
new file mode 100644
index 0000000..a68c6d3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_02.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.
+ */
+x y
+x y a b
+x y a.b
+x y a
+a b c() d e
+a b c()() d e
+a b c[x] d e
+a b c[x][y] d e
+a b c {x} d e
+(1 + 2).plus 3 plus 4
+[1, 2].subList 0, 1 plus 2

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
new file mode 100644
index 0000000..313fd8b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
@@ -0,0 +1,84 @@
+/*
+ *  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.
+ */
+println withPool {
+}
+
+println aa("bb", "cc") {
+}
+
+println this.aa("bb", "cc") {
+}
+
+println aa("bb", {println 123;}, "cc") {
+}
+
+aa("bb", "cc") {
+    println 1
+} { println 2 }
+
+cc  {
+    println 1
+} {
+    println 2
+}
+
+dd {
+    println 3
+}
+
+obj.cc  {
+    println 1
+} {
+    println 2
+}
+
+bb 1, 2, {println 123;}
+
+obj."some method" (groovy.xml.dom.DOMCategory) {
+}
+
+obj."some ${'method'}" (groovy.xml.dom.DOMCategory) {
+}
+obj.someMethod (groovy.xml.dom.DOMCategory) {
+}
+
+use (groovy.xml.dom.DOMCategory) {
+}
+
+['a','b','c'].inject('x') {
+    result, item -> item + result + item
+}
+
+println a."${hello}"('world') {
+}
+
+println a."${"$hello"}"('world') {
+}
+
+a."${"$hello"}" 'world', {
+}
+
+a.<String, Object>someMethod 'hello', 'world';
+
+a[x] b
+a[x] b c
+a[x] b c d
+
+"$x"(1, 2) a
+"$x" 1, 2  a

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
new file mode 100644
index 0000000..ba3b2c3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 }
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } someProperty
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } 'someProperty'
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "someProperty"
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "somePropert${'y'}"
+result = [1, 2, 3].size().plus 1 plus 2
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
new file mode 100644
index 0000000..06205a7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
@@ -0,0 +1,77 @@
+/*
+ *  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.
+ */
+((int) 1 / 2)(1, 2) {} {} (2, 3, 4) {}
+(((int) 1 / 2))(1, 2) {} {} (2, 3, 4) {}
+(m())()
+((Integer)m())()
+
+((int) 1 / 2) 1, 2 {} {} (2, 3, 4) {}
+
+'m'() + /aa/() + $/bb/$() + "$m"() + /a${'x'}a/() + $/b${'x'}b/$() + 1.2('b') + 1('a') + 2() + null() + true() + false() + a() + {a,b->}(1, 2) + [1, 2]() + [a:1, b:2]() + new int[0]() + new Integer(1)()
+
+// cast expressions
+(int)(1 / 2)
+(Integer)(1 / 2)
+(java.lang.Integer)(1 / 2)
+
+
+
+1 + 1.("a" + "1")()
+1 + 1.(m())()
+1.("a" + "1")()
+1.("a" + "1")(123)
+1.("a" + "1") 123
+1.(m())()
+1.(m())(123)
+1.(m()) 123
+(1+1).("a"+1)()
+(1+1).("a"+1) a b c
+1+1.("a"+1)()
+
+x = a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+x = obj.a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = obj.a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+x = {a, b -> }(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = {a, b -> }(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {}
+x = {a, b -> }(1, 2) {} {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+
+
+
+m 1, 2
+"m" 1, 2
+"$m" 1, 2
+
+("m") 1, 2
+("$m") 1, 2
+
+find x:
+        1 confirm right
+
+
+find x:
+        1,
+        y:
+                2 confirm right
+
+a b 1 2
+
+
+(obj.m1(1, 2)) m2(3, 4)
+obj.m1(1, 2) m2(3, 4)

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
new file mode 100644
index 0000000..64c94bb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+assert 11 == (1.plus 2 plus 3) + (2.plus 3) * (1.multiply 1) - ((1 - 1).intdiv 1 multiply 1) / (2.power 10)
+assert (Long)(1.plus 2 plus 3) instanceof Long
+assert [1, 2, 3] == [(1.plus 0), (1.plus 1), (1.plus 1 plus 1)]
+
+def m(a, b) {
+    return a + b
+}
+assert m((1.plus 2 plus 3), (1.multiply 1)) == 7

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
new file mode 100644
index 0000000..b01ee37
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+#!/usr/bin/env groovy
+/*
+ *  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.
+ */
+
+/**
+ * Created by Daniel.Sun on 2016/08/16.
+ */
+
+// this is a line comment
+
+println /* method name */ 1 /* one */ /* followed by plus */ + /* plus */ 2 /* two */
++3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
new file mode 100644
index 0000000..dcb4b76
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
@@ -0,0 +1,135 @@
+/*
+ *  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.
+ */
+/**
+ * test class Comments
+ */
+public class Comments {
+    /**
+     * test Comments.SOME_VAR
+     */
+    public static final String SOME_VAR = 'SOME_VAR';
+    /**
+     * test Comments.SOME_VAR2
+     */
+    public static final String SOME_VAR2 = 'SOME_VAR2';
+
+    public static final String SOME_VAR3 = 'SOME_VAR3';
+
+    /**
+     * test Comments.SOME_VAR4
+     */
+    // no groovydoc for SOME_VAR4
+    public static final String SOME_VAR4 = 'SOME_VAR4';
+
+
+    /**
+     * test Comments.constructor1
+     */
+    public Comments() {
+
+    }
+
+    /**
+     * test Comments.m1
+     */
+    def m1() {
+        // executing m1
+    }
+
+    /*
+     * test Comments.m2
+     */
+    private m2() {
+        // executing m2
+    }
+
+    /**
+     * test Comments.m3
+     */
+    public void m3() {
+        // executing m3
+    }
+
+    /**
+     * test class InnerClazz
+     */
+    static class InnerClazz {
+        /**
+         * test InnerClazz.SOME_VAR3
+         */
+        public static final String SOME_VAR3 = 'SOME_VAR3';
+        /**
+         * test InnerClazz.SOME_VAR4
+         */
+        public static final String SOME_VAR4 = 'SOME_VAR4';
+
+        /**
+         * test Comments.m4
+         */
+        public void m4() {
+            // executing m4
+        }
+
+        /**
+         * test Comments.m5
+         */
+        public void m5() {
+            // executing m5
+        }
+    }
+
+    /**
+     * test class InnerEnum
+     */
+    static enum InnerEnum {
+        /**
+         * InnerEnum.NEW
+         */
+        NEW,
+
+        /**
+         * InnerEnum.OLD
+         */
+        OLD
+    }
+
+    static enum InnerEnum2 {}
+}
+
+/**
+ * test class Comments2
+ */
+class Comments2 {
+    /*
+     * test Comments.SOME_VAR
+     */
+    public static final String SOME_VAR = 'SOME_VAR';
+}
+
+class Comments3 {}
+
+/**
+ * test someScriptMethod1
+ */
+void someScriptMethod1() {}
+
+/*
+ * test someScriptMethod2
+ */
+void someScriptMethod2() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
new file mode 100644
index 0000000..7f0c2b0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
@@ -0,0 +1,39 @@
+/*
+ *  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 Greetable {
+    String name();
+    default String hello() {
+        return 'hello'
+    }
+    default public String sayHello() {
+        return this.hello() + ', ' + this.name()
+    }
+}
+
+class Person implements Greetable {
+    @Override
+    public String name() {
+        return 'Daniel'
+    }
+}
+
+def p = new Person()
+assert 'hello, Daniel' == "${p.hello()}, ${p.name()}"
+assert 'hello, Daniel' == p.sayHello()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
new file mode 100644
index 0000000..18e564b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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 A {
+    default String hello() {
+        return 'hello'
+    }
+    default String a() {
+        return 'a'
+    }
+    String b();
+}
+
+interface B extends A {
+    public String world();
+}
+
+class C implements B {
+    public static String haha() { return 'haha' }
+
+    public String world() {
+        return 'world'
+    }
+
+    public String name() {
+        return 'c'
+    }
+
+    public String a() {
+        return 'a1';
+    }
+
+    public String b() {
+        return 'b'
+    }
+}
+
+def c = new C()
+assert 'hello, world, c, a1, b, haha' == "${c.hello()}, ${c.world()}, ${c.name()}, ${c.a()}, ${c.b()}, ${C.haha()}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
new file mode 100644
index 0000000..ffdda82
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+int i = 0;
+
+do {
+    i++
+} while (i < 5)
+
+assert i == 5

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
new file mode 100644
index 0000000..5cec460
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+int i = 0;
+
+do {
+    i++
+    if (i == 3) break;
+} while (i < 5)
+
+assert i == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
new file mode 100644
index 0000000..abddd24
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.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.
+ */
+int i, j = 0;
+
+do {
+    i++
+    if (i == 4) break;
+
+    if (j == 3) continue;
+    j++
+} while (true)
+
+assert j == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
new file mode 100644
index 0000000..f32e88b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+@CompileStatic
+def a() {
+    int i = 0;
+    int result = 0;
+   do {
+        result += 2
+    } while(i++ < 2)
+        result += 3
+
+    return result;
+}
+assert 9 == a()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/73acbcfe/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
new file mode 100644
index 0000000..17d1bab
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
@@ -0,0 +1,56 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+def elvisAssignment() {
+    def a = 2
+    a ?= 1
+    assert a == 2
+
+    a = null
+    a ?= 1
+    assert a == 1
+
+    a = null
+    a ?= a ?= 1
+    assert a == 1
+
+    a = null
+    assert (a ?= '2') == '2'
+}
+elvisAssignment();
+
+@CompileStatic
+def csElvisAssignment() {
+    def a = 2
+    a ?= 1
+    assert a == 2
+
+    a = null
+    a ?= 1
+    assert a == 1
+
+    a = null
+    a ?= a ?= 1
+    assert a == 1
+
+    a = null
+    assert (a ?= '2') == '2'
+}
+csElvisAssignment();