You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/04/04 13:41:04 UTC

[groovy] 01/02: Tweak `compilationUnit` rule

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

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

commit 3049428d0a2d9ceaa7997f4b21eadd9c00fdf641
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 4 20:13:08 2020 +0800

    Tweak `compilationUnit` rule
    
    (cherry picked from commit c4c8c3afa11eb7b44e1efa4d887a7f421f2eef73)
---
 src/antlr/GroovyParser.g4 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 2833376..a126114 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -97,8 +97,7 @@ options {
 
 // starting point for parsing a groovy file
 compilationUnit
-    :   nls
-        packageDeclaration? sep? scriptStatements? EOF
+    :   nls (packageDeclaration sep?)? scriptStatements? EOF
     ;
 
 scriptStatements