36 if constexpr( not ParseState::minified_document ) {
38 auto first = daw::not_null<char const *>( parse_state.first );
39 auto const last = daw::not_null<char const *>( parse_state.last );
44 if constexpr( ParseState::is_zero_terminated_string ) {
47 (
static_cast<unsigned>(
static_cast<unsigned char>( *first ) ) -
54 DAW_LIKELY( first < last ) and
55 (
static_cast<unsigned>(
static_cast<unsigned char>( *first ) ) -
60 parse_state.first = first;
83 auto pf = daw::not_null( daw::never_null, parse_state.first );
84 auto pl = daw::not_null( daw::never_null, parse_state.last );
86 json_details::memchr_unchecked<
'"',
87 typename ParseState::exec_tag_t,
88 ParseState::expect_long_strings>( pf,
95 static_assert(
sizeof...( keys ) > 0 );
96 static_assert(
sizeof...( keys ) <= 16 );
98 if( not json_details::use_constexpr_exec_mode<
99 typename ParseState::exec_tag_t>( ) ) {
100 auto pf = daw::not_null<char const *>{ parse_state.first };
101 auto pl = daw::not_null<char const *>{ parse_state.last };
103 json_details::mempbrk<ParseState::is_unchecked_input,
104 typename ParseState::exec_tag_t,
105 ParseState::expect_long_strings,
108 auto first = daw::not_null<char const *>( parse_state.first );
109 auto const last = daw::not_null<char const *>( parse_state.last );
115 if( ParseState::is_zero_terminated_string ) {
117 ErrorReason::UnexpectedEndOfData,
119 while( not parse_policy_details::in<keys...>( *first ) ) {
123 *first !=
'\0', ErrorReason::UnexpectedEndOfData, parse_state );
126 first < last, ErrorReason::UnexpectedEndOfData, parse_state );
127 while( not parse_policy_details::in<keys...>( *first ) ) {
130 first < last, ErrorReason::UnexpectedEndOfData, parse_state );
133 parse_state.first = first;
145 constexpr char PrimLeft =
146 BracketedType == json_details::SkipBracketedType::Class ?
'{' :
'[';
147 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
148 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
149 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
152 auto ptr_first = daw::not_null<char const *>( parse_state.first );
153 auto const ptr_last = daw::not_null<char const *>( parse_state.last );
154 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
157 auto result = parse_state;
159 std::uint32_t prime_bracket_count = 1;
160 std::uint32_t second_bracket_count = 0;
162 if( *ptr_first == PrimLeft ) {
165 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
166 switch( *ptr_first ) {
172 ptr_first = json_details::mem_skip_until_end_of_string<
173 ParseState::is_unchecked_input,
174 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
176 ErrorReason::UnexpectedEndOfData,
180 if( DAW_UNLIKELY( ( prime_bracket_count == 1 ) &
181 ( second_bracket_count == 0 ) ) ) {
186 ++prime_bracket_count;
188 case PrimRight::value:
189 --prime_bracket_count;
190 if( prime_bracket_count == 0 ) {
193 ErrorReason::InvalidBracketing,
195 result.last = ptr_first;
196 result.counter = cnt;
197 parse_state.first = ptr_first;
202 ++second_bracket_count;
204 case SecRight::value:
205 --second_bracket_count;
211 ( second_bracket_count == 0 ),
212 ErrorReason::InvalidBracketing,
216 result.last = ptr_first;
217 result.counter = cnt;
218 parse_state.first = ptr_first;
226 constexpr char PrimLeft =
227 BracketedType == json_details::SkipBracketedType::Class ?
'{' :
'[';
229 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
230 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
231 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
233 auto result = parse_state;
235 std::uint32_t prime_bracket_count = 1;
236 std::uint32_t second_bracket_count = 0;
237 auto ptr_first = daw::not_null<char const *>( parse_state.first );
238 auto const ptr_last = daw::not_null<char const *>( parse_state.last );
240 if( *ptr_first == PrimLeft ) {
244 switch( *ptr_first ) {
250 ptr_first = json_details::mem_skip_until_end_of_string<
251 ParseState::is_unchecked_input,
252 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
255 if( DAW_UNLIKELY( ( prime_bracket_count == 1 ) &
256 ( second_bracket_count == 0 ) ) ) {
261 ++prime_bracket_count;
263 case PrimRight::value:
264 --prime_bracket_count;
265 if( prime_bracket_count == 0 ) {
269 result.last = ptr_first;
270 result.counter = cnt;
271 parse_state.first = ptr_first;
276 ++second_bracket_count;
278 case SecRight::value:
279 --second_bracket_count;