changes to address #295

This commit is contained in:
Niels 2016-08-17 23:14:28 +02:00
parent 628a5eae50
commit 039cedaf8e
2 changed files with 8 additions and 4 deletions

View file

@ -8892,7 +8892,8 @@ basic_json_parser_63:
{ {
case lexer::token_type::begin_object: 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 {} // explicitly set result to object to cope with {}
result.m_type = value_t::object; result.m_type = value_t::object;
@ -8970,7 +8971,8 @@ basic_json_parser_63:
case lexer::token_type::begin_array: 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 [] // explicitly set result to object to cope with []
result.m_type = value_t::array; result.m_type = value_t::array;

View file

@ -8189,7 +8189,8 @@ class basic_json
{ {
case lexer::token_type::begin_object: 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 {} // explicitly set result to object to cope with {}
result.m_type = value_t::object; result.m_type = value_t::object;
@ -8267,7 +8268,8 @@ class basic_json
case lexer::token_type::begin_array: 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 [] // explicitly set result to object to cope with []
result.m_type = value_t::array; result.m_type = value_t::array;