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 2022/07/20 01:09:02 UTC

[groovy] branch master updated (028f414bb8 -> 63bcab1bf1)

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 028f414bb8 GROOVY-10689: Groovydoc for Groovy 3+ documents classes at too early a phase of compilation
     new 009c4f026e update 19ea version
     new 63bcab1bf1 GROOVY-10681: Groovysh doesn't handle multiline strings with """ or ''' correctly (also relaxed parser)

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:
 .github/workflows/groovy-build-test-ea.yml         |  2 +-
 .../groovy/groovysh/antlr4/RelaxedParser.groovy    | 29 ++++++++--------------
 2 files changed, 12 insertions(+), 19 deletions(-)


[groovy] 01/02: update 19ea version

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 009c4f026e228a8674968aeb8721da0f17a9cde9
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Jul 20 10:48:49 2022 +1000

    update 19ea version
---
 .github/workflows/groovy-build-test-ea.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/groovy-build-test-ea.yml b/.github/workflows/groovy-build-test-ea.yml
index a4b408a380..24e9d8f86d 100644
--- a/.github/workflows/groovy-build-test-ea.yml
+++ b/.github/workflows/groovy-build-test-ea.yml
@@ -25,7 +25,7 @@ jobs:
         os: [ubuntu-18.04]
         java: [17]
         # The jdk links of "install-jdk.sh" are sometimes outdated, so we have to download openjdk releases from https://jdk.java.net/ by ourselves.
-        jdk: ["https://download.java.net/java/early_access/jdk19/28/GPL/openjdk-19-ea+28_linux-x64_bin.tar.gz"]
+        jdk: ["https://download.java.net/java/early_access/jdk19/31/GPL/openjdk-19-ea+31_linux-x64_bin.tar.gz"]
     runs-on: ${{ matrix.os }}
     steps:
       - name: Download JDK ${{ matrix.jdk }}


[groovy] 02/02: GROOVY-10681: Groovysh doesn't handle multiline strings with """ or ''' correctly (also relaxed parser)

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 63bcab1bf13fb3811626fb1727c22e86528feb7f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Jul 20 11:06:53 2022 +1000

    GROOVY-10681: Groovysh doesn't handle multiline strings with """ or ''' correctly (also relaxed parser)
---
 .../groovy/groovysh/antlr4/RelaxedParser.groovy    | 29 ++++++++--------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/antlr4/RelaxedParser.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/antlr4/RelaxedParser.groovy
index 6102eea808..112c663e74 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/antlr4/RelaxedParser.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/antlr4/RelaxedParser.groovy
@@ -27,6 +27,7 @@ import org.apache.groovy.groovysh.ParseStatus
 import org.apache.groovy.groovysh.Parser
 import org.apache.groovy.groovysh.Parsing
 import org.apache.groovy.parser.antlr4.GroovyLangLexer
+import org.apache.groovy.parser.antlr4.GroovySyntaxError
 import org.codehaus.groovy.tools.shell.util.Logger
 
 /**
@@ -50,24 +51,16 @@ final class RelaxedParser implements Parsing {
             tokenStream.fill()
 
             log.debug('Parse complete')
-
             return new ParseStatus(ParseCode.COMPLETE)
-        }
-        catch (e) {
-            log.debug(e)
-            switch (e.getClass()) {
-                // TODO determine appropriate antlr4 exceptions or detect EOF earlier at end of stream
-//                case TokenStreamException:
-//                case RecognitionException:
-//                    log.debug("Parse incomplete: $e (${e.getClass().name})")
-//
-//                    return new ParseStatus(ParseCode.INCOMPLETE)
-
-                default:
-                    log.debug("Parse error: $e (${e.getClass().name})")
-
-                    return new ParseStatus(e)
-            }
+        } catch (GroovySyntaxError e) {
+            if ((e.message.contains('Unexpected input: ') || e.message.contains('Unexpected character: ')) && !(
+                    e.message.contains("Unexpected input: '}'")
+                            || e.message.contains("Unexpected input: ')'")
+                            || e.message.contains("Unexpected input: ']'")))
+                return new ParseStatus(ParseCode.INCOMPLETE)
+        } catch (Exception e) {
+            log.debug("Parse error: $e (${e.getClass().name})")
+            return new ParseStatus(e)
         }
     }
-}
\ No newline at end of file
+}