Skip to content

Commit

Permalink
changes to address #295
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Aug 17, 2016
1 parent 628a5ea commit 039ceda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8892,7 +8892,8 @@ class basic_json
{
case lexer::token_type::begin_object:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::object_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
{
// explicitly set result to object to cope with {}
result.m_type = value_t::object;
Expand Down Expand Up @@ -8970,7 +8971,8 @@ class basic_json

case lexer::token_type::begin_array:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::array_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
{
// explicitly set result to object to cope with []
result.m_type = value_t::array;
Expand Down
6 changes: 4 additions & 2 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -8189,7 +8189,8 @@ class basic_json
{
case lexer::token_type::begin_object:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::object_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
{
// explicitly set result to object to cope with {}
result.m_type = value_t::object;
Expand Down Expand Up @@ -8267,7 +8268,8 @@ class basic_json

case lexer::token_type::begin_array:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::array_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
{
// explicitly set result to object to cope with []
result.m_type = value_t::array;
Expand Down

0 comments on commit 039ceda

Please sign in to comment.