mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +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);
|
||||
lastValue_->setComment(std::string(begin, end), placement);
|
||||
} else {
|
||||
if (!commentsBefore_.empty())
|
||||
commentsBefore_ += "\n";
|
||||
commentsBefore_ += std::string(begin, end);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,8 @@
|
||||
},
|
||||
// C++-style comment
|
||||
"cpp-test" : {
|
||||
// Internal comment cpp-style
|
||||
// Multiline comment cpp-style
|
||||
// Second line
|
||||
"c" : 3,
|
||||
"d" : 4
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user