Skip to content

Commit

Permalink
pkg/ast: fix struct comment parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dvyukov committed Sep 4, 2017
1 parent a54dce0 commit f400a0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/ast/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 11 additions & 0 deletions pkg/ast/testdata/all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

0 comments on commit f400a0d

Please sign in to comment.