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:
Cory Quammen 2014-10-07 23:53:16 -04:00
parent 4d23492d11
commit fd06bfca79
2 changed files with 2 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -9,7 +9,8 @@
},
// C++-style comment
"cpp-test" : {
// Internal comment cpp-style
// Multiline comment cpp-style
// Second line
"c" : 3,
"d" : 4
}