http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy new file mode 100644 index 0000000..94a183e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy @@ -0,0 +1,284 @@ +/* + * 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 + +import java.io.* + + +class Resource implements Closeable { + int resourceId; + static closedResourceIds = []; + static exMsg = "failed to close"; + + public Resource(int resourceId) { + this.resourceId = resourceId; + } + + public void close() { + if (3 == resourceId) throw new IOException(exMsg); + + closedResourceIds << resourceId + } +} + +// test case 1 +def a = 1; +try (Resource r1 = new Resource(1)) { + a = 2; +} +assert Resource.closedResourceIds == [1] +assert 2 == a + +// test case 2 +Resource.closedResourceIds = [] +final exMsg = "resource not found"; +try { + // try { ... } should throw the IOException, while the resource should be closed + try (Resource r1 = new Resource(2)) { + throw new FileNotFoundException(exMsg) + } +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() +} +assert Resource.closedResourceIds == [2] + +// test case 3 +Resource.closedResourceIds = [] +a = 1; +try { + try (Resource r1 = new Resource(3)) { + a = 2; + } +} catch (IOException e) { + assert Resource.exMsg == e.getMessage() +} +assert 2 == a; +assert Resource.closedResourceIds == [] + +// test case 4 +Resource.closedResourceIds = [] +try { + // try { ... } should throw the IOException, while the resource should be closed + try (Resource r1 = new Resource(3)) { + throw new FileNotFoundException(exMsg) + } +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() + + def suppressedExceptions = e.getSuppressed(); + assert suppressedExceptions.length == 1 + assert suppressedExceptions[0] instanceof IOException + assert suppressedExceptions[0].getMessage() == Resource.exMsg +} +assert Resource.closedResourceIds == [] + + +// test case 5 +Resource.closedResourceIds = [] +a = 1; +try (Resource r1 = new Resource(5); +Resource r2 = new Resource(6);) { + a = 2; +} +assert Resource.closedResourceIds == [6, 5] +assert 2 == a + +// test case 6 +Resource.closedResourceIds = [] +a = 1; +try (Resource r1 = new Resource(5); +Resource r2 = new Resource(6); +Resource r3 = new Resource(7);) { + a = 2; +} +assert Resource.closedResourceIds == [7, 6, 5] +assert 2 == a + + +// test case 7 +Resource.closedResourceIds = [] +try (Resource r1 = new Resource(7)) { + throw new FileNotFoundException(exMsg) +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() +} +assert Resource.closedResourceIds == [7] + +// test case 8 +Resource.closedResourceIds = [] +try (Resource r1 = new Resource(7); +Resource r2 = new Resource(8)) { + throw new FileNotFoundException(exMsg) +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() +} +assert Resource.closedResourceIds == [8, 7] + + +// test case 9 +Resource.closedResourceIds = [] +a = 1; +try (Resource r1 = new Resource(3)) { + a = 2; +} catch (IOException e) { + assert Resource.exMsg == e.getMessage() +} +assert 2 == a; +assert Resource.closedResourceIds == [] + + +// test case 10 +Resource.closedResourceIds = [] +a = 1; +try (Resource r1 = new Resource(3); +Resource r2 = new Resource(4)) { + a = 2; +} catch (IOException e) { + assert Resource.exMsg == e.getMessage() +} +assert 2 == a; +assert Resource.closedResourceIds == [4] + +// test case 11 +Resource.closedResourceIds = [] +a = 1; +try (Resource r0 = new Resource(2); +Resource r1 = new Resource(3); +Resource r2 = new Resource(4)) { + a = 2; +} catch (IOException e) { + assert Resource.exMsg == e.getMessage() +} +assert 2 == a; +assert Resource.closedResourceIds == [4, 2] + + +// test case 12 +Resource.closedResourceIds = [] +try (Resource r1 = new Resource(3); +Resource r2 = new Resource(4)) { + throw new FileNotFoundException(exMsg) +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() + + def suppressedExceptions = e.getSuppressed(); + assert suppressedExceptions.length == 1 + assert suppressedExceptions[0] instanceof IOException + assert suppressedExceptions[0].getMessage() == Resource.exMsg +} +assert Resource.closedResourceIds == [4] + +// test case 13 +Resource.closedResourceIds = [] +try (Resource r0 = new Resource(2); +Resource r1 = new Resource(3); +Resource r2 = new Resource(4)) { + throw new FileNotFoundException(exMsg) +} catch(FileNotFoundException e) { + assert exMsg == e.getMessage() + + def suppressedExceptions = e.getSuppressed(); + assert suppressedExceptions.length == 1 + assert suppressedExceptions[0] instanceof IOException + assert suppressedExceptions[0].getMessage() == Resource.exMsg +} +assert Resource.closedResourceIds == [4, 2] + +// test case 14 +Resource.closedResourceIds = [] +a = 1; +try (Resource r1 = new Resource(1)) { + a += 2; + try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) { + a += 3; + try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) { + a += 4; + try { + try (Resource r3 = new Resource(3)) { + a += 5; + } + } catch (IOException e) { + assert Resource.exMsg == e.getMessage() + } + } + } catch(Exception e) { + // ignored + } finally { + a += 10 + } +} +assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1] +assert 25 == a + +// test case 15 +@CompileStatic +void tryWithResources() { + Resource.closedResourceIds = [] + int cs = 1; + try (Resource r1 = new Resource(1)) { + cs += 2; + try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) { + cs += 3; + try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) { + cs += 4; + try { + try (Resource r3 = new Resource(3)) { + cs += 5; + } + } catch (IOException e) { + assert Resource.exMsg == e.getMessage() + } + } + } catch(Exception e) { + // ignored + } finally { + cs += 10 + } + } + assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1] + assert 25 == cs +} + +tryWithResources() + + +// test case 16 +Resource.closedResourceIds = [] +a = 1; +try ( + Resource r1 = new Resource( + 1 +) + Resource r2 = new Resource(2) +) { + a = 2; +} +assert Resource.closedResourceIds == [2, 1] +assert 2 == a + +// test case 17 +Resource.closedResourceIds = [] +a = 1; +try (r1 = new Resource(1) + r2 = new Resource(2)) { + a = 2; +} +assert Resource.closedResourceIds == [2, 1] +assert 2 == a +
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy new file mode 100644 index 0000000..a065baa --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.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 \u0061 = '\uuuuu0061' +def \u0061\u0062 +def \u0061\u0062\u0063 +def \u0061\u0062\u00639 +def \u0061cC\u0062Bb\u00639aA +def a\u00615\u00626\u0063Z +def A\u00617\u00628\u0063z + +def \u0061\u0062() {} + +class \u0061 { + def \u0061\u0062 + + def \u0061cC\u0062Bb\u00639aA() {} +} +interface \u0061 {} +enum \u0061 { + \u0061cC\u0062Bb\u00639aA, \u0061cC\u0062Bb\u00639aA2 +} +trait \u0061 {} +@interface \u0061 {} + + + http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy new file mode 100644 index 0000000..cbf0249 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy @@ -0,0 +1,76 @@ +/* + * 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. + */ +while(true) assert true + +while( + true +) assert true + +while(true) + assert true + +while(true) { + break; +} + +out: +while(true) { + break out; +} + +out1: +while(true) { + break out1; + out2: while (true) { + break out2; + } +} + + +while(true) { + continue +} + +out: +while(true) { + continue out; +} + +out1: +while(true) { + continue out1; + out2: while (true) { + continue out2; + } +} + +out1: +while(true) { + continue out1; + out2: while (true) { + break out2; + } +} + + +while (false) + int number = 1 + +while(true); + http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy new file mode 100644 index 0000000..e099280 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy @@ -0,0 +1,23 @@ +/* + * 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 +while (i < 5) { + i++ +} +assert 5 == i; http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy new file mode 100644 index 0000000..8dae1bd --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.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. + */ +class A { + def x() +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy new file mode 100644 index 0000000..80a041c --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.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. + */ +enum E { + A, B + def y() +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy new file mode 100644 index 0000000..92ace61 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.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. + */ +trait B { + def z() +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy new file mode 100644 index 0000000..409fa18 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.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. + */ +def w() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy new file mode 100644 index 0000000..aec108e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.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. + */ +abstract v() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy new file mode 100644 index 0000000..7672201 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.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. + */ +abstract u() {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy new file mode 100644 index 0000000..14c8d30 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.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. + */ +break \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy new file mode 100644 index 0000000..f08680b --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.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. + */ +if (true) { + break; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy new file mode 100644 index 0000000..b60a794 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_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. + */ +package fail + +class A { + String foo() {} + def foo() {} +} +new A() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy new file mode 100644 index 0000000..607c5b5 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_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. + */ +[].for(1;2;3){println "in loop"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy new file mode 100644 index 0000000..29a16ec --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_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. + */ +def x = (1;2;3) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy new file mode 100644 index 0000000..dab42a1 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_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. + */ +[].bar(1;2;3) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy new file mode 100644 index 0000000..5783cbd --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.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. + */ +class Crasher { + public void m() { + def fields = [1,2,3] + def expectedFieldNames = ["patentnumber", "status"]. + for (int i=0; i<fields.size(); i++) { + Object f = fields[i] + System.out.println(f); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy new file mode 100644 index 0000000..1318c4a --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_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. + */ +class Foo { static final Foo() {}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy new file mode 100644 index 0000000..4a23bf8 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.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. + */ +continue; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy new file mode 100644 index 0000000..744b34a --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.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. + */ +if (true) { + continue; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy new file mode 100644 index 0000000..b770cfb --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.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. + */ +do +println 123 +println 123 +while(false) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy new file mode 100644 index 0000000..4313d66 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_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. + */ +int() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy new file mode 100644 index 0000000..d469216 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_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. + */ +1 = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy new file mode 100644 index 0000000..904f84e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_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. + */ +m() = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy new file mode 100644 index 0000000..0d4e9af --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.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. + */ +this = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy new file mode 100644 index 0000000..58cf67c --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_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. + */ +super = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy new file mode 100644 index 0000000..220518d --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.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. + */ +[1, 2] = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy new file mode 100644 index 0000000..6f6f9b0 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.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. + */ +[a: 1, b: 2] = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy new file mode 100644 index 0000000..fb47d45 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.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. + */ +"$x" = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy new file mode 100644 index 0000000..4c1958c --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.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. + */ +'x' = 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy new file mode 100644 index 0000000..694dfed --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/For_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. + */ +for (*a; a.size() < 10;) {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy new file mode 100644 index 0000000..359b9ca --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/For_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. + */ +for (; a.size() < 10; *a) {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy new file mode 100644 index 0000000..312818e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.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. + */ +interface Foo { + def doit( String param = "Groovy", int o ) +} http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy new file mode 100644 index 0000000..b625423 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/List_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. + */ +[,] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy new file mode 100644 index 0000000..590cb87 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_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. + */ +@Test2 (int c, int d) = [1, 2] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy new file mode 100644 index 0000000..a8f27ad --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy @@ -0,0 +1,23 @@ +/* + * 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 say(String msg) { + println(msg) + } +}() http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy new file mode 100644 index 0000000..d7d4ce7 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.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. + */ +def def m() {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy new file mode 100644 index 0000000..fcb609a --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.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. + */ +public public class A {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy new file mode 100644 index 0000000..de1f024 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.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. + */ +final final int a = 1; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy new file mode 100644 index 0000000..4b495ad --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.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. + */ +class A { + private public a +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy new file mode 100644 index 0000000..d19ca6c --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.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. + */ +class A { + protected public a +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy new file mode 100644 index 0000000..2134472 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.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. + */ +volatile x() {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy new file mode 100644 index 0000000..dc1585a --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.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. + */ +(1 + 2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy new file mode 100644 index 0000000..e2ce8a4 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.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. + */ +(1 + 2)) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy new file mode 100644 index 0000000..af33a2e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.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. + */ +(1 + 2] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy new file mode 100644 index 0000000..976b0d2 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.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. + */ +def a( { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy new file mode 100644 index 0000000..8abe436 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy @@ -0,0 +1,24 @@ +/* + * 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 A { + A(int a) { + println a + super(123) + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy new file mode 100644 index 0000000..c548d86 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.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. + */ +switch (a) { + case 1: + break; + default: + break; + default: + break; +} + http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy new file mode 100644 index 0000000..d3fdc44 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/This_01x.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. + */ +class A { + A(int a) { + println a + this() + } + + A() {} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy new file mode 100644 index 0000000..5beccbe --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.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. + */ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy new file mode 100644 index 0000000..fdeb7c4 --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.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. + */ +class MyClass { + void field +} http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy new file mode 100644 index 0000000..748003e --- /dev/null +++ b/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy @@ -0,0 +1,23 @@ +/* + * 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 MyClass { + def foo() { + void bar = null + } +}