| 565 | } |
| 566 | |
| 567 | bool Reader::readComment() { |
| 568 | Location commentBegin = current_ - 1; |
| 569 | Char c = getNextChar(); |
| 570 | bool successful = false; |
| 571 | if (c == '*') |
| 572 | successful = readCStyleComment(); |
| 573 | else if (c == '/') |
| 574 | successful = readCppStyleComment(); |
| 575 | if (!successful) |
| 576 | return false; |
| 577 | |
| 578 | if (collectComments_) { |
| 579 | CommentPlacement placement = commentBefore; |
| 580 | if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { |
| 581 | if (c != '*' || !containsNewLine(commentBegin, current_)) |
| 582 | placement = commentAfterOnSameLine; |
| 583 | } |
| 584 | |
| 585 | addComment(commentBegin, current_, placement); |
| 586 | } |
| 587 | return true; |
| 588 | } |
| 589 | |
| 590 | static JSONCPP_STRING normalizeEOL(Reader::Location begin, Reader::Location end) { |
| 591 | JSONCPP_STRING normalized; |
nothing calls this directly
no test coverage detected