Run clang-format

This commit is contained in:
Jacob Bundgaard 2019-11-04 13:29:17 +01:00 committed by Christopher Dunn
parent 554d961625
commit 1c8f7d8ae5
2 changed files with 18 additions and 5 deletions

View File

@ -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

View File

@ -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);