aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/ast/parser.go2
-rw-r--r--pkg/ast/testdata/all.txt11
2 files changed, 13 insertions, 0 deletions
diff --git a/pkg/ast/parser.go b/pkg/ast/parser.go
index 214be7fb9..9e1ab679e 100644
--- a/pkg/ast/parser.go
+++ b/pkg/ast/parser.go
@@ -353,6 +353,8 @@ func (p *parser) parseCommentBlock() []*Comment {
for p.tok == tokComment {
comments = append(comments, p.parseComment())
p.consume(tokNewLine)
+ for p.tryConsume(tokNewLine) {
+ }
}
return comments
}
diff --git a/pkg/ast/testdata/all.txt b/pkg/ast/testdata/all.txt
index 9ddf67844..b71b7919c 100644
--- a/pkg/ast/testdata/all.txt
+++ b/pkg/ast/testdata/all.txt
@@ -28,3 +28,14 @@ include <linux/foo.h>
include "linux/foo.h"
incdir </foo/bar>
incdir "/foo/bar"
+
+s2 {
+ f1 int8
+
+ # comment
+
+ f2 int8
+
+ # comment
+
+}