mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01: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.
|
/// \c true if comments are allowed. Default: \c true.
|
||||||
bool allowComments_{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};
|
bool allowTrailingCommas_{true};
|
||||||
|
|
||||||
/// \c true if root must be either an array or an object value. Default: \c
|
/// \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);
|
initialTokenOk = readToken(tokenName);
|
||||||
if (!initialTokenOk)
|
if (!initialTokenOk)
|
||||||
break;
|
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;
|
return true;
|
||||||
name.clear();
|
name.clear();
|
||||||
if (tokenName.type_ == tokenString) {
|
if (tokenName.type_ == tokenString) {
|
||||||
@ -506,7 +508,11 @@ bool Reader::readArray(Token& token) {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
skipSpaces();
|
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;
|
Token endArray;
|
||||||
readToken(endArray);
|
readToken(endArray);
|
||||||
@ -1440,7 +1446,9 @@ bool OurReader::readObject(Token& token) {
|
|||||||
initialTokenOk = readToken(tokenName);
|
initialTokenOk = readToken(tokenName);
|
||||||
if (!initialTokenOk)
|
if (!initialTokenOk)
|
||||||
break;
|
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;
|
return true;
|
||||||
name.clear();
|
name.clear();
|
||||||
if (tokenName.type_ == tokenString) {
|
if (tokenName.type_ == tokenString) {
|
||||||
@ -1497,7 +1505,11 @@ bool OurReader::readArray(Token& token) {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
skipSpaces();
|
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;
|
Token endArray;
|
||||||
readToken(endArray);
|
readToken(endArray);
|
||||||
|
Loading…
Reference in New Issue
Block a user