Skip to content

Commit 8d4ef8b

Browse files
committed
Run clang-format
1 parent 72aa518 commit 8d4ef8b

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
@@ -454,7 +454,9 @@ bool Reader::readObject(Token& token) {
454454
initialTokenOk = readToken(tokenName);
455455
if (!initialTokenOk)
456456
break;
457-
if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma
457+
if (tokenName.type_ == tokenObjectEnd &&
458+
(name.empty() ||
459+
features_.allowTrailingCommas_)) // empty object or trailing comma
458460
return true;
459461
name.clear();
460462
if (tokenName.type_ == tokenString) {
@@ -505,7 +507,11 @@ bool Reader::readArray(Token& token) {
505507
int index = 0;
506508
for (;;) {
507509
skipSpaces();
508-
if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma
510+
if (current_ != end_ && *current_ == ']' &&
511+
(index == 0 ||
512+
(features_.allowTrailingCommas_ &&
513+
!features_.allowDroppedNullPlaceholders_))) // empty array or trailing
514+
// comma
509515
{
510516
Token endArray;
511517
readToken(endArray);
@@ -1424,7 +1430,9 @@ bool OurReader::readObject(Token& token) {
14241430
initialTokenOk = readToken(tokenName);
14251431
if (!initialTokenOk)
14261432
break;
1427-
if (tokenName.type_ == tokenObjectEnd && (name.empty() || features_.allowTrailingCommas_)) // empty object or trailing comma
1433+
if (tokenName.type_ == tokenObjectEnd &&
1434+
(name.empty() ||
1435+
features_.allowTrailingCommas_)) // empty object or trailing comma
14281436
return true;
14291437
name.clear();
14301438
if (tokenName.type_ == tokenString) {
@@ -1481,7 +1489,11 @@ bool OurReader::readArray(Token& token) {
14811489
int index = 0;
14821490
for (;;) {
14831491
skipSpaces();
1484-
if (current_ != end_ && *current_ == ']' && (index == 0 || (features_.allowTrailingCommas_ && !features_.allowDroppedNullPlaceholders_))) // empty array or trailing comma
1492+
if (current_ != end_ && *current_ == ']' &&
1493+
(index == 0 ||
1494+
(features_.allowTrailingCommas_ &&
1495+
!features_.allowDroppedNullPlaceholders_))) // empty array or trailing
1496+
// comma
14851497
{
14861498
Token endArray;
14871499
readToken(endArray);

0 commit comments

Comments
 (0)