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 12:14:47 UTC

[groovy] branch master updated: Tweak `compilationUnit` rule

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c4c8c3a  Tweak `compilationUnit` rule
c4c8c3a is described below

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

    Tweak `compilationUnit` rule
---
 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