mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-13 10:22:55 +01:00
Removed unneeded newlines from parsed comments
Newlines from comments separated by lines are retained when comments are appended, so adding a newline between separate comments for a node is not needed.
This commit is contained in:
parent
4d23492d11
commit
fd06bfca79
@ -358,8 +358,6 @@ Reader::addComment(Location begin, Location end, CommentPlacement placement) {
|
|||||||
assert(lastValue_ != 0);
|
assert(lastValue_ != 0);
|
||||||
lastValue_->setComment(std::string(begin, end), placement);
|
lastValue_->setComment(std::string(begin, end), placement);
|
||||||
} else {
|
} else {
|
||||||
if (!commentsBefore_.empty())
|
|
||||||
commentsBefore_ += "\n";
|
|
||||||
commentsBefore_ += std::string(begin, end);
|
commentsBefore_ += std::string(begin, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
},
|
},
|
||||||
// C++-style comment
|
// C++-style comment
|
||||||
"cpp-test" : {
|
"cpp-test" : {
|
||||||
// Internal comment cpp-style
|
// Multiline comment cpp-style
|
||||||
|
// Second line
|
||||||
"c" : 3,
|
"c" : 3,
|
||||||
"d" : 4
|
"d" : 4
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user