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 2019/03/16 05:19:07 UTC
[groovy] branch master updated (c6b9d21 -> 801decc)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.
from c6b9d21 GROOVY-9037: adjust java grammar to partially understand "default" in interfaces (just enough to keep groovydoc processing of java files happy)
new 7835ba9 minor refactor - pull out a constant
new 801decc GROOVY-9038: rework antlr2 java grammar to partially understand try-with-resources (minor tweak)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/main/antlr2/org/codehaus/groovy/antlr/java/java.g | 2 +-
.../groovy/internal/util/UnicodeConst.java} | 6 +++---
.../java/org/apache/groovy/json/internal/JsonParserCharArray.java | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
copy src/main/java/org/{codehaus/groovy/util/Finalizable.java => apache/groovy/internal/util/UnicodeConst.java} (88%)
[groovy] 02/02: GROOVY-9038: rework antlr2 java grammar to
partially understand try-with-resources (minor tweak)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 801decc4cd738d5c70bc8db641b4e1fc615dd56d
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Mar 16 15:18:03 2019 +1000
GROOVY-9038: rework antlr2 java grammar to partially understand try-with-resources (minor tweak)
---
src/main/antlr2/org/codehaus/groovy/antlr/java/java.g | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/antlr2/org/codehaus/groovy/antlr/java/java.g b/src/main/antlr2/org/codehaus/groovy/antlr/java/java.g
index dd7b244..96046a5 100644
--- a/src/main/antlr2/org/codehaus/groovy/antlr/java/java.g
+++ b/src/main/antlr2/org/codehaus/groovy/antlr/java/java.g
@@ -1214,7 +1214,7 @@ forIter {Token first = LT(1);}
// TODO currently handles try-with-resources only enough for groovydoc, not java2groovy
// plan is to switch java2groovy over to using parrot parser (or some other alternative)
tryBlock
- : "try"^ ((LPAREN) => resources)? compoundStatement
+ : "try"^ ((LPAREN) => resources!)? compoundStatement
(handler)*
( finallyClause )?
;
[groovy] 01/02: minor refactor - pull out a constant
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 7835ba90a89efe7e944854ede73348efd11b4daa
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Mar 16 15:15:52 2019 +1000
minor refactor - pull out a constant
---
.../apache/groovy/internal/util/UnicodeConst.java | 23 ++++++++++++++++++++++
.../groovy/json/internal/JsonParserCharArray.java | 4 ++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/groovy/internal/util/UnicodeConst.java b/src/main/java/org/apache/groovy/internal/util/UnicodeConst.java
new file mode 100644
index 0000000..cb56ebd
--- /dev/null
+++ b/src/main/java/org/apache/groovy/internal/util/UnicodeConst.java
@@ -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.
+ */
+package org.apache.groovy.internal.util;
+
+public class UnicodeConst {
+ public static char ZERO = '\u0000';
+}
diff --git a/subprojects/groovy-json/src/main/java/org/apache/groovy/json/internal/JsonParserCharArray.java b/subprojects/groovy-json/src/main/java/org/apache/groovy/json/internal/JsonParserCharArray.java
index 08613d0..bbaf64f 100644
--- a/subprojects/groovy-json/src/main/java/org/apache/groovy/json/internal/JsonParserCharArray.java
+++ b/subprojects/groovy-json/src/main/java/org/apache/groovy/json/internal/JsonParserCharArray.java
@@ -19,6 +19,7 @@
package org.apache.groovy.json.internal;
import groovy.json.JsonException;
+import org.apache.groovy.internal.util.UnicodeConst;
import java.util.ArrayList;
import java.util.List;
@@ -70,8 +71,7 @@ public class JsonParserCharArray extends BaseJsonParser {
__index++;
return __currentChar = charArray[__index];
} else {
- // TODO move unicode 0 to separate file to avoid doc parsing issues
- return '\u0000';
+ return UnicodeConst.ZERO;
}
} catch (Exception ex) {
throw new JsonException(exceptionDetails("unable to advance character"), ex);