(*printer).nextComment increases cindex by one after each call
and it always points to the next element.
Change-Id: I65754ab6e30e10dc7473882e39737d2e0dc29070
GitHub-Last-Rev:
f859283324af6ddf9fdc75ef08ee42ae26bc581b
GitHub-Pull-Request: golang/go#68032
Reviewed-on: https://go-review.googlesource.com/c/go/+/592557
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
)
type commentInfo struct {
- cindex int // current comment index
- comment *ast.CommentGroup // = printer.comments[cindex]; or nil
- commentOffset int // = printer.posFor(printer.comments[cindex].List[0].Pos()).Offset; or infinity
+ cindex int // index of the next comment
+ comment *ast.CommentGroup // = printer.comments[cindex-1]; or nil
+ commentOffset int // = printer.posFor(printer.comments[cindex-1].List[0].Pos()).Offset; or infinity
commentNewline bool // true if the comment group contains newlines
}