From 35b7bbff4f554b1f09b0d32f42c1271c06c1ece7 Mon Sep 17 00:00:00 2001
From: Johannes Mey <johannes.mey@tu-dresden.de>
Date: Tue, 1 Jun 2021 21:28:35 +0200
Subject: [PATCH] no whitespace/comment required between rules

---
 src/main/jastadd/parser/RelAst.parser | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/jastadd/parser/RelAst.parser b/src/main/jastadd/parser/RelAst.parser
index c4cfd43..628e452 100644
--- a/src/main/jastadd/parser/RelAst.parser
+++ b/src/main/jastadd/parser/RelAst.parser
@@ -1,6 +1,5 @@
 GrammarFile goal
   = comment_list.c grammar_file.f {: f.getDeclarationList().insertChild(new EmptyDeclaration(c), 0); return f; :}
-  | grammar_file
 ;
 
 GrammarFile grammar_file
@@ -16,8 +15,8 @@ Declaration declaration
 // this method would be create by the JAstAddParser from a usage of
 // 'comment+' in a rule, but only for the standard list class 'List'.
 JastAddList comment_list
-  = comment.n {: return new JastAddList().add(n); :}
-  | comment_list.l comment.n {: return l.add(n); :}
+  = comment.c comment_list.l {: l.insertChild(c, 0); return l; :}
+  | /* epsilon */            {: return new JastAddList(); :}
 ;
 
 Comment comment
-- 
GitLab