(comments []string)
| 390 | } |
| 391 | |
| 392 | func removeTrailingWhitespace(comments []string) []string { |
| 393 | end := len(comments) |
| 394 | for i := len(comments) - 1; i >= 0; i-- { |
| 395 | trimmed := trimEnd(comments[i]) |
| 396 | if trimmed == "" { |
| 397 | end = i |
| 398 | } else { |
| 399 | comments[i] = trimmed |
| 400 | break |
| 401 | } |
| 402 | } |
| 403 | return comments[:end] |
| 404 | } |
| 405 | |
| 406 | func (p *Parser) isNextNonwhitespaceTokenEndOfFile() bool { |
| 407 | // We must use infinite lookahead, as there could be any number of newlines :( |
no test coverage detected