diff --git a/include/json/json_features.h b/include/json/json_features.h index 8ba1e8f..c12d647 100644 --- a/include/json/json_features.h +++ b/include/json/json_features.h @@ -45,7 +45,8 @@ public: /// \c true if comments are allowed. Default: \c true. bool allowComments_{true}; - /// \c true if trailing commas in objects and arrays are allowed. Default \c true. + /// \c true if trailing commas in objects and arrays are allowed. Default \c + /// true. bool allowTrailingCommas_{true}; /// \c true if root must be either an array or an object value. Default: \c diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index aa788cd..63b6937 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -455,7 +455,9 @@ bool Reader::readObject(Token& token) { initialTokenOk = readToken(tokenName); if (!initialTokenOk) break; - if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma + if (tokenName.type_ == tokenObjectEnd && + (name.empty() || + features_.allowTrailingCommas_)) // empty object or trailing comma return true; name.clear(); if (tokenName.type_ == tokenString) { @@ -506,7 +508,11 @@ bool Reader::readArray(Token& token) { int index = 0; for (;;) { skipSpaces(); - if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma + if (current_ != end_ && *current_ == ']' && + (index == 0 || + (features_.allowTrailingCommas_ && + !features_.allowDroppedNullPlaceholders_))) // empty array or trailing + // comma { Token endArray; readToken(endArray); @@ -1440,7 +1446,9 @@ bool OurReader::readObject(Token& token) { initialTokenOk = readToken(tokenName); if (!initialTokenOk) break; - if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma + if (tokenName.type_ == tokenObjectEnd && + (name.empty() || + features_.allowTrailingCommas_)) // empty object or trailing comma return true; name.clear(); if (tokenName.type_ == tokenString) { @@ -1497,7 +1505,11 @@ bool OurReader::readArray(Token& token) { int index = 0; for (;;) { skipSpaces(); - if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma + if (current_ != end_ && *current_ == ']' && + (index == 0 || + (features_.allowTrailingCommas_ && + !features_.allowDroppedNullPlaceholders_))) // empty array or trailing + // comma { Token endArray; readToken(endArray);