Skip to content

Commit f400a0d

Browse files
committed
pkg/ast: fix struct comment parsing
1 parent a54dce0 commit f400a0d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkg/ast/parser.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ func (p *parser) parseCommentBlock() []*Comment {
353353
for p.tok == tokComment {
354354
comments = append(comments, p.parseComment())
355355
p.consume(tokNewLine)
356+
for p.tryConsume(tokNewLine) {
357+
}
356358
}
357359
return comments
358360
}

pkg/ast/testdata/all.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ include <linux/foo.h>
2828
include "linux/foo.h"
2929
incdir </foo/bar>
3030
incdir "/foo/bar"
31+
32+
s2 {
33+
f1 int8
34+
35+
# comment
36+
37+
f2 int8
38+
39+
# comment
40+
41+
}

0 commit comments

Comments
 (0)