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