31 while( parse_state.front( ) ==
'/' ) {
32 switch( *( parse_state.first + 1 ) ) {
34 parse_state.template move_to_next_of_unchecked<'\n'>( );
35 parse_state.remove_prefix( );
38 parse_state.remove_prefix( 2 );
40 parse_state.template move_to_next_of_unchecked<'*'>( );
41 parse_state.remove_prefix( );
42 if( parse_state.front( ) ==
'/' ) {
43 parse_state.remove_prefix( );
46 parse_state.remove_prefix( );
58 while( parse_state.has_more( ) and parse_state.front( ) ==
'/' ) {
59 if( not parse_state.has_more( ) ) {
62 switch( *( parse_state.first + 1 ) ) {
64 parse_state.template move_to_next_of_checked<'\n'>( );
65 if( parse_state.has_more( ) ) {
66 parse_state.remove_prefix( );
70 parse_state.remove_prefix( 2 );
71 while( parse_state.has_more( ) ) {
72 parse_state.template move_to_next_of_checked<'*'>( );
73 if( parse_state.has_more( ) ) {
74 parse_state.remove_prefix( );
76 if( not parse_state.has_more( ) ) {
78 }
else if( parse_state.front( ) ==
'/' ) {
79 parse_state.remove_prefix( );
82 parse_state.remove_prefix( );
105 skip_comments_checked( parse_state );
106 while( parse_state.has_more( ) and parse_state.is_space_unchecked( ) ) {
107 parse_state.remove_prefix( );
108 skip_comments_checked( parse_state );
130 skip_comments( parse_state );
132 ErrorReason::UnexpectedEndOfData, parse_state );
133 while( not parse_policy_details::in<keys...>( parse_state.front( ) ) ) {
135 ErrorReason::UnexpectedEndOfData, parse_state );
136 parse_state.remove_prefix( );
137 skip_comments( parse_state );
148 constexpr char PrimRight = PrimLeft ==
'{' ?
'}' :
']';
149 constexpr char SecLeft = PrimLeft ==
'{' ?
'[' :
'{';
150 constexpr char SecRight = SecLeft ==
'{' ?
'}' :
']';
151 using CharT =
typename ParseState::CharT;
153 auto result = parse_state;
155 std::uint32_t prime_bracket_count = 1;
156 std::uint32_t second_bracket_count = 0;
157 CharT *ptr_first = parse_state.first;
158 CharT *
const ptr_last = parse_state.last;
159 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
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>( ParseState::exec_tag, ptr_first,
176 ErrorReason::UnexpectedEndOfData, parse_state );
179 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
184 ++prime_bracket_count;
187 --prime_bracket_count;
188 if( prime_bracket_count == 0 ) {
190 ErrorReason::InvalidBracketing, parse_state );
194 result.last = ptr_first;
195 result.counter = cnt;
196 parse_state.first = ptr_first;
201 ++second_bracket_count;
204 --second_bracket_count;
209 ErrorReason::UnexpectedEndOfData, parse_state );
210 switch( *ptr_first ) {
213 while( ( ptr_last - ptr_first ) > 1 and *ptr_first !=
'\n' ) {
219 while( ( ptr_last - ptr_first ) >= 3 and *ptr_first !=
'*' and
220 *std::next( ptr_first ) !=
'/' ) {
232 ( second_bracket_count == 0 ),
233 ErrorReason::InvalidBracketing, parse_state );
236 result.last = ptr_first;
237 result.counter = cnt;
238 parse_state.first = ptr_first;
245 constexpr char PrimRight = PrimLeft ==
'{' ?
'}' :
']';
246 constexpr char SecLeft = PrimLeft ==
'{' ?
'[' :
'{';
247 constexpr char SecRight = SecLeft ==
'{' ?
'}' :
']';
249 using CharT =
typename ParseState::CharT;
250 auto result = parse_state;
252 std::uint32_t prime_bracket_count = 1;
253 std::uint32_t second_bracket_count = 0;
254 CharT *ptr_first = parse_state.first;
255 if( *ptr_first == PrimLeft ) {
259 switch( *ptr_first ) {
265 ptr_first = json_details::mem_skip_until_end_of_string<
266 ParseState::is_unchecked_input>( ParseState::exec_tag, ptr_first,
270 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
275 ++prime_bracket_count;
278 --prime_bracket_count;
279 if( prime_bracket_count == 0 ) {
283 result.last = ptr_first;
284 result.counter = cnt;
285 parse_state.first = ptr_first;
290 ++second_bracket_count;
293 --second_bracket_count;
297 switch( *ptr_first ) {
300 while( *ptr_first !=
'\n' ) {
306 while( *ptr_first !=
'*' and *std::next( ptr_first ) !=
'/' ) {