Skip to content

Commit 1c8f7d8

Browse files
kimsey0cdunn2001
authored andcommitted
Run clang-format
1 parent 554d961 commit 1c8f7d8

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

include/json/json_features.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class JSON_API Features {
4545
/// \c true if comments are allowed. Default: \c true.
4646
bool allowComments_{true};
4747

48-
/// \c true if trailing commas in objects and arrays are allowed. Default \c true.
48+
/// \c true if trailing commas in objects and arrays are allowed. Default \c
49+
/// true.
4950
bool allowTrailingCommas_{true};
5051

5152
/// \c true if root must be either an array or an object value. Default: \c

src/lib_json/json_reader.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,9 @@ bool Reader::readObject(Token& token) {
455455
initialTokenOk = readToken(tokenName);
456456
if (!initialTokenOk)
457457
break;
458-
if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma
458+
if (tokenName.type_ == tokenObjectEnd &&
459+
(name.empty() ||
460+
features_.allowTrailingCommas_)) // empty object or trailing comma
459461
return true;
460462
name.clear();
461463
if (tokenName.type_ == tokenString) {
@@ -506,7 +508,11 @@ bool Reader::readArray(Token& token) {
506508
int index = 0;
507509
for (;;) {
508510
skipSpaces();
509-
if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma
511+
if (current_ != end_ && *current_ == ']' &&
512+
(index == 0 ||
513+
(features_.allowTrailingCommas_ &&
514+
!features_.allowDroppedNullPlaceholders_))) // empty array or trailing
515+
// comma
510516
{
511517
Token endArray;
512518
readToken(endArray);
@@ -1440,7 +1446,9 @@ bool OurReader::readObject(Token& token) {
14401446
initialTokenOk = readToken(tokenName);
14411447
if (!initialTokenOk)
14421448
break;
1443-
if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma
1449+
if (tokenName.type_ == tokenObjectEnd &&
1450+
(name.empty() ||
1451+
features_.allowTrailingCommas_)) // empty object or trailing comma
14441452
return true;
14451453
name.clear();
14461454
if (tokenName.type_ == tokenString) {
@@ -1497,7 +1505,11 @@ bool OurReader::readArray(Token& token) {
14971505
int index = 0;
14981506
for (;;) {
14991507
skipSpaces();
1500-
if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma
1508+
if (current_ != end_ && *current_ == ']' &&
1509+
(index == 0 ||
1510+
(features_.allowTrailingCommas_ &&
1511+
!features_.allowDroppedNullPlaceholders_))) // empty array or trailing
1512+
// comma
15011513
{
15021514
Token endArray;
15031515
readToken(endArray);

0 commit comments

Comments
 (0)