44 while( parse_state.has_more( ) and parse_state.front( ) ==
'#' ) {
45 parse_state.remove_prefix( );
46 parse_state.template move_to_next_of_checked<'\n'>( );
47 if( parse_state.front( ) ==
'\n' ) {
48 parse_state.remove_prefix( );
67 skip_comments_checked( parse_state );
68 while( parse_state.has_more( ) and parse_state.is_space_unchecked( ) ) {
69 parse_state.remove_prefix( );
70 skip_comments_checked( parse_state );
92 skip_comments( parse_state );
95 ErrorReason::UnexpectedEndOfData,
97 while( not parse_policy_details::in<keys...>( parse_state.front( ) ) ) {
99 ErrorReason::UnexpectedEndOfData,
101 parse_state.remove_prefix( );
102 skip_comments( parse_state );
114 DAW_CPP23_STATIC_LOCAL
constexpr char PrimLeft =
115 BracketedType == json_details::SkipBracketedType::Class ?
'{' :
'[';
116 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
117 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
118 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
121 auto result = parse_state;
123 std::uint32_t prime_bracket_count = 1;
124 std::uint32_t second_bracket_count = 0;
125 auto ptr_first = daw::not_null( parse_state.first );
126 auto const ptr_last = daw::not_null( parse_state.last );
127 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
130 if( *ptr_first == PrimLeft ) {
133 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
135 switch( *ptr_first ) {
141 if constexpr( std::is_same_v<
char *,
142 typename ParseState::iterator> ) {
143 auto skip_ptr = json_details::mem_skip_until_end_of_string<
144 ParseState::is_unchecked_input,
145 typename ParseState::exec_tag_t>( ptr_first.get( ),
147 ptr_first += skip_ptr - ptr_first.get( );
149 ptr_first = json_details::mem_skip_until_end_of_string<
150 ParseState::is_unchecked_input,
151 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
154 ErrorReason::UnexpectedEndOfData,
158 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
163 ++prime_bracket_count;
165 case PrimRight::value:
166 --prime_bracket_count;
167 if( prime_bracket_count == 0 ) {
169 ErrorReason::InvalidBracketing,
174 result.last = ptr_first;
175 result.counter = cnt;
176 parse_state.first = ptr_first;
181 ++second_bracket_count;
183 case SecRight::value:
184 --second_bracket_count;
188 while( ptr_first < ptr_last and *ptr_first !=
'\n' ) {
191 if( ptr_first < ptr_last ) {
199 ( second_bracket_count == 0 ),
200 ErrorReason::InvalidBracketing,
204 result.last = ptr_first;
205 result.counter = cnt;
206 parse_state.first = ptr_first;
214 DAW_CPP23_STATIC_LOCAL
constexpr char PrimLeft =
215 BracketedType == json_details::SkipBracketedType::Class ?
'{' :
'[';
217 using PrimRight = daw::constant<PrimLeft ==
'{' ?
'}' :
']'>;
218 using SecLeft = daw::constant<PrimLeft ==
'{' ?
'[' :
'{'>;
219 using SecRight = daw::constant<SecLeft::value ==
'{' ?
'}' :
']'>;
221 auto result = parse_state;
223 std::uint32_t prime_bracket_count = 1;
224 std::uint32_t second_bracket_count = 0;
225 auto ptr_first = daw::not_null( daw::never_null, parse_state.first );
226 auto const ptr_last =
227 daw::not_null( daw::never_null, parse_state.last );
228 if( *ptr_first == PrimLeft ) {
232 switch( *ptr_first ) {
239 if constexpr( std::is_same_v<
char *,
240 typename ParseState::iterator> ) {
241 auto skip_ptr = json_details::mem_skip_until_end_of_string<
242 ParseState::is_unchecked_input,
243 typename ParseState::exec_tag_t>( ptr_first.get( ),
245 ptr_first += skip_ptr - ptr_first.get( );
247 ptr_first = json_details::mem_skip_until_end_of_string<
248 ParseState::is_unchecked_input,
249 typename ParseState::exec_tag_t>( ptr_first, ptr_last );
253 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
258 ++prime_bracket_count;
260 case PrimRight::value:
261 --prime_bracket_count;
262 if( prime_bracket_count == 0 ) {
266 result.last = ptr_first;
267 result.counter = cnt;
268 parse_state.first = ptr_first;
273 ++second_bracket_count;
275 case SecRight::value:
276 --second_bracket_count;
280 while( *ptr_first !=
'\n' ) {