| 511 | } |
| 512 | |
| 513 | bool Reader::readComment() { |
| 514 | Location commentBegin = current_ - 1; |
| 515 | Char c = getNextChar(); |
| 516 | bool successful = false; |
| 517 | if (c == '*') |
| 518 | successful = readCStyleComment(); |
| 519 | else if (c == '/') |
| 520 | successful = readCppStyleComment(); |
| 521 | if (!successful) |
| 522 | return false; |
| 523 | |
| 524 | if (collectComments_) { |
| 525 | CommentPlacement placement = commentBefore; |
| 526 | if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { |
| 527 | if (c != '*' || !containsNewLine(commentBegin, current_)) |
| 528 | placement = commentAfterOnSameLine; |
| 529 | } |
| 530 | |
| 531 | addComment(commentBegin, current_, placement); |
| 532 | } |
| 533 | return true; |
| 534 | } |
| 535 | |
| 536 | void |
| 537 | Reader::addComment(Location begin, Location end, CommentPlacement placement) { |
nothing calls this directly
no test coverage detected