| 531 | } |
| 532 | |
| 533 | bool Reader::readComment() { |
| 534 | Location commentBegin = current_ - 1; |
| 535 | Char c = getNextChar(); |
| 536 | bool successful = false; |
| 537 | if (c == '*') |
| 538 | successful = readCStyleComment(); |
| 539 | else if (c == '/') |
| 540 | successful = readCppStyleComment(); |
| 541 | if (!successful) |
| 542 | return false; |
| 543 | |
| 544 | if (collectComments_) { |
| 545 | CommentPlacement placement = commentBefore; |
| 546 | if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { |
| 547 | if (c != '*' || !containsNewLine(commentBegin, current_)) |
| 548 | placement = commentAfterOnSameLine; |
| 549 | } |
| 550 | |
| 551 | addComment(commentBegin, current_, placement); |
| 552 | } |
| 553 | return true; |
| 554 | } |
| 555 | |
| 556 | static std::string normalizeEOL(Reader::Location begin, Reader::Location end) { |
| 557 | std::string normalized; |
nothing calls this directly
no test coverage detected