33 while( parse_state.front( ) ==
'/' ) {
34 switch( *( parse_state.first + 1 ) ) {
36 parse_state.template move_to_next_of_unchecked<'\n'>( );
37 parse_state.remove_prefix( );
40 parse_state.remove_prefix( 2 );
42 parse_state.template move_to_next_of_unchecked<'*'>( );
43 parse_state.remove_prefix( );
44 if( parse_state.front( ) ==
'/' ) {
45 parse_state.remove_prefix( );
48 parse_state.remove_prefix( );
60 while( parse_state.has_more( ) and parse_state.front( ) ==
'/' ) {
61 if( not parse_state.has_more( ) ) {
64 switch( *( parse_state.first + 1 ) ) {
66 parse_state.template move_to_next_of_checked<'\n'>( );
67 if( parse_state.has_more( ) ) {
68 parse_state.remove_prefix( );
72 parse_state.remove_prefix( 2 );
73 while( parse_state.has_more( ) ) {
74 parse_state.template move_to_next_of_checked<'*'>( );
75 if( parse_state.has_more( ) ) {
76 parse_state.remove_prefix( );
78 if( not parse_state.has_more( ) ) {
80 }
else if( parse_state.front( ) ==
'/' ) {
81 parse_state.remove_prefix( );
84 parse_state.remove_prefix( );
107 skip_comments_checked( parse_state );
108 while( parse_state.has_more( ) and parse_state.is_space_unchecked( ) ) {
109 parse_state.remove_prefix( );
110 skip_comments_checked( parse_state );
132 skip_comments( parse_state );
134 ErrorReason::UnexpectedEndOfData,
136 while( not parse_policy_details::in<keys...>( parse_state.front( ) ) ) {
138 ErrorReason::UnexpectedEndOfData,
140 parse_state.remove_prefix( );
141 skip_comments( parse_state );
152 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
153 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
154 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
157 auto result = parse_state;
159 std::uint32_t prime_bracket_count = 1;
160 std::uint32_t second_bracket_count = 0;
161 auto ptr_first = daw::not_null<char const *>( parse_state.first );
162 auto const ptr_last = daw::not_null<char const *>( parse_state.last );
163 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
166 if( *ptr_first == PrimLeft ) {
169 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
170 switch( *ptr_first ) {
176 ptr_first = json_details::mem_skip_until_end_of_string<
177 ParseState::is_unchecked_input,
178 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
180 ErrorReason::UnexpectedEndOfData,
184 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
189 ++prime_bracket_count;
191 case PrimRight::value:
192 --prime_bracket_count;
193 if( prime_bracket_count == 0 ) {
195 ErrorReason::InvalidBracketing,
200 result.last = ptr_first;
201 result.counter = cnt;
202 parse_state.first = ptr_first;
207 ++second_bracket_count;
209 case SecRight::value:
210 --second_bracket_count;
215 ErrorReason::UnexpectedEndOfData,
217 switch( *ptr_first ) {
220 while( ( ptr_last - ptr_first ) > 1 and *ptr_first !=
'\n' ) {
226 while( ( ptr_last - ptr_first ) >= 3 and *ptr_first !=
'*' and
227 *std::next( ptr_first.get( ) ) !=
'/' ) {
239 ( second_bracket_count == 0 ),
240 ErrorReason::InvalidBracketing,
244 result.last = ptr_first;
245 result.counter = cnt;
246 parse_state.first = ptr_first;
253 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
254 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
255 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
258 auto result = parse_state;
260 std::uint32_t prime_bracket_count = 1;
261 std::uint32_t second_bracket_count = 0;
263 daw::not_null<char const *>( daw::never_null, parse_state.first );
264 auto const ptr_last =
265 daw::not_null<char const *>( daw::never_null, parse_state.last );
266 if( *ptr_first == PrimLeft ) {
270 switch( *ptr_first ) {
276 ptr_first = json_details::mem_skip_until_end_of_string<
277 ParseState::is_unchecked_input,
278 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
281 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
286 ++prime_bracket_count;
288 case PrimRight::value:
289 --prime_bracket_count;
290 if( prime_bracket_count == 0 ) {
294 result.last = ptr_first;
295 result.counter = cnt;
296 parse_state.first = ptr_first;
301 ++second_bracket_count;
303 case SecRight::value:
304 --second_bracket_count;
308 switch( *ptr_first ) {
311 while( *ptr_first !=
'\n' ) {
317 while( *ptr_first !=
'*' and
318 *std::next( ptr_first.get( ) ) !=
'/' ) {