mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-08 11:02:16 +01:00
09439b7bc7
This patch fixes some aspects of reading and writing comments: - Multiple C++-style comments before a Json value had extra newlines appended to them. This patch removes the addition of those newlines. - Comments written before Json values in the StyledWriter were not indented to match the indentation level of the value. This patch adds indentation to comments. - Fixed inconsistency in newlines following C- and C++-style comments being saved as part of the comment. All newlines at the end of a comment are now removed. - Added an additional test of comments. https://sourceforge.net/p/jsoncpp/patches/25/
17 lines
252 B
JSON
17 lines
252 B
JSON
{
|
|
/* C-style comment
|
|
|
|
C-style-2 comment */
|
|
"c-test" : {
|
|
"a" : 1,
|
|
/* Internal comment c-style */
|
|
"b" : 2
|
|
},
|
|
// C++-style comment
|
|
"cpp-test" : {
|
|
// Internal comment cpp-style
|
|
"c" : 3,
|
|
"d" : 4
|
|
}
|
|
}
|