| 8934 | } |
| 8935 | |
| 8936 | bool start_array(std::size_t len) |
| 8937 | { |
| 8938 | ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); |
| 8939 | |
| 8940 | #if JSON_DIAGNOSTIC_POSITIONS |
| 8941 | // Manually set the start position of the array here. |
| 8942 | // Ensure this is after the call to handle_value to ensure correct start position. |
| 8943 | if (m_lexer_ref) |
| 8944 | { |
| 8945 | ref_stack.back()->start_position = m_lexer_ref->get_position() - 1; |
| 8946 | } |
| 8947 | #endif |
| 8948 | |
| 8949 | if (JSON_HEDLEY_UNLIKELY(len != detail::unknown_size() && len > ref_stack.back()->max_size())) |
| 8950 | { |
| 8951 | JSON_THROW(out_of_range::create(408, concat("excessive array size: ", std::to_string(len)), ref_stack.back())); |
| 8952 | } |
| 8953 | |
| 8954 | return true; |
| 8955 | } |
| 8956 | |
| 8957 | bool end_array() |
| 8958 | { |