mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 10:41:03 +08:00
Run clang-format
This commit is contained in:
parent
554d961625
commit
1c8f7d8ae5
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user