🔨 working toward #367

This commit is contained in:
Niels Lohmann 2017-05-20 12:44:13 +02:00
parent 8a35fdd8f5
commit 16b63d3197
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69

View file

@ -12532,6 +12532,7 @@ scan_number_done:
if (strict) if (strict)
{ {
get_token();
expect(lexer::token_type::end_of_input); expect(lexer::token_type::end_of_input);
} }
@ -12593,7 +12594,6 @@ scan_number_done:
// closing } -> we are done // closing } -> we are done
if (last_token == lexer::token_type::end_object) if (last_token == lexer::token_type::end_object)
{ {
get_token();
if (keep and callback and not callback(--depth, parse_event_t::object_end, result)) if (keep and callback and not callback(--depth, parse_event_t::object_end, result))
{ {
result = basic_json(value_t::discarded); result = basic_json(value_t::discarded);
@ -12635,6 +12635,7 @@ scan_number_done:
} }
// comma -> next value // comma -> next value
get_token();
if (last_token == lexer::token_type::value_separator) if (last_token == lexer::token_type::value_separator)
{ {
get_token(); get_token();
@ -12643,7 +12644,6 @@ scan_number_done:
// closing } // closing }
expect(lexer::token_type::end_object); expect(lexer::token_type::end_object);
get_token();
break; break;
} }
@ -12671,7 +12671,6 @@ scan_number_done:
// closing ] -> we are done // closing ] -> we are done
if (last_token == lexer::token_type::end_array) if (last_token == lexer::token_type::end_array)
{ {
get_token();
if (callback and not callback(--depth, parse_event_t::array_end, result)) if (callback and not callback(--depth, parse_event_t::array_end, result))
{ {
result = basic_json(value_t::discarded); result = basic_json(value_t::discarded);
@ -12690,6 +12689,7 @@ scan_number_done:
} }
// comma -> next value // comma -> next value
get_token();
if (last_token == lexer::token_type::value_separator) if (last_token == lexer::token_type::value_separator)
{ {
get_token(); get_token();
@ -12698,7 +12698,6 @@ scan_number_done:
// closing ] // closing ]
expect(lexer::token_type::end_array); expect(lexer::token_type::end_array);
get_token();
break; break;
} }
@ -12713,14 +12712,12 @@ scan_number_done:
case lexer::token_type::literal_null: case lexer::token_type::literal_null:
{ {
result.m_type = value_t::null; result.m_type = value_t::null;
get_token();
break; break;
} }
case lexer::token_type::value_string: case lexer::token_type::value_string:
{ {
result = basic_json(m_lexer.get_string()); result = basic_json(m_lexer.get_string());
get_token();
break; break;
} }
@ -12728,7 +12725,6 @@ scan_number_done:
{ {
result.m_type = value_t::boolean; result.m_type = value_t::boolean;
result.m_value = true; result.m_value = true;
get_token();
break; break;
} }
@ -12736,7 +12732,6 @@ scan_number_done:
{ {
result.m_type = value_t::boolean; result.m_type = value_t::boolean;
result.m_value = false; result.m_value = false;
get_token();
break; break;
} }
@ -12744,7 +12739,6 @@ scan_number_done:
{ {
result.m_type = value_t::number_unsigned; result.m_type = value_t::number_unsigned;
result.m_value = m_lexer.get_number_unsigned(); result.m_value = m_lexer.get_number_unsigned();
get_token();
break; break;
} }
@ -12752,7 +12746,6 @@ scan_number_done:
{ {
result.m_type = value_t::number_integer; result.m_type = value_t::number_integer;
result.m_value = m_lexer.get_number_integer(); result.m_value = m_lexer.get_number_integer();
get_token();
break; break;
} }
@ -12767,7 +12760,6 @@ scan_number_done:
JSON_THROW(out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); JSON_THROW(out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'"));
} }
get_token();
break; break;
} }