pkg/ast: fix struct comment parsing

This commit is contained in:
Dmitry Vyukov 2017-09-04 20:24:09 +02:00
parent a54dce007d
commit f400a0da0f
2 changed files with 13 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}