42 while( parse_state.has_more( ) and parse_state.front( ) ==
'#' ) {
43 parse_state.remove_prefix( );
44 parse_state.template move_to_next_of_checked<'\n'>( );
45 if( parse_state.front( ) ==
'\n' ) {
46 parse_state.remove_prefix( );
65 skip_comments_checked( parse_state );
66 while( parse_state.has_more( ) and parse_state.is_space_unchecked( ) ) {
67 parse_state.remove_prefix( );
68 skip_comments_checked( parse_state );
90 skip_comments( parse_state );
93 ErrorReason::UnexpectedEndOfData, parse_state );
94 while( not parse_policy_details::in<keys...>( parse_state.front( ) ) ) {
96 ErrorReason::UnexpectedEndOfData, parse_state );
97 parse_state.remove_prefix( );
98 skip_comments( parse_state );
109 constexpr char PrimRight = PrimLeft ==
'{' ?
'}' :
']';
110 constexpr char SecLeft = PrimLeft ==
'{' ?
'[' :
'{';
111 constexpr char SecRight = SecLeft ==
'{' ?
'}' :
']';
112 using CharT =
typename ParseState::CharT;
114 auto result = parse_state;
116 std::uint32_t prime_bracket_count = 1;
117 std::uint32_t second_bracket_count = 0;
118 CharT *ptr_first = parse_state.first;
119 CharT *
const ptr_last = parse_state.last;
120 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
123 if( *ptr_first == PrimLeft ) {
126 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
128 switch( *ptr_first ) {
134 ptr_first = json_details::mem_skip_until_end_of_string<
135 ParseState::is_unchecked_input>( ParseState::exec_tag, ptr_first,
138 ErrorReason::UnexpectedEndOfData, parse_state );
141 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
146 ++prime_bracket_count;
149 --prime_bracket_count;
150 if( prime_bracket_count == 0 ) {
152 ErrorReason::InvalidBracketing, parse_state );
156 result.last = ptr_first;
157 result.counter = cnt;
158 parse_state.first = ptr_first;
163 ++second_bracket_count;
166 --second_bracket_count;
170 while( ptr_first < ptr_last and *ptr_first !=
'\n' ) {
173 if( ptr_first < ptr_last ) {
181 ( second_bracket_count == 0 ),
182 ErrorReason::InvalidBracketing, parse_state );
185 result.last = ptr_first;
186 result.counter = cnt;
187 parse_state.first = ptr_first;
195 constexpr char PrimRight = PrimLeft ==
'{' ?
'}' :
']';
196 constexpr char SecLeft = PrimLeft ==
'{' ?
'[' :
'{';
197 constexpr char SecRight = SecLeft ==
'{' ?
'}' :
']';
198 using CharT =
typename ParseState::CharT;
199 auto result = parse_state;
201 std::uint32_t prime_bracket_count = 1;
202 std::uint32_t second_bracket_count = 0;
203 CharT *ptr_first = parse_state.first;
204 if( *ptr_first == PrimLeft ) {
208 switch( *ptr_first ) {
214 ptr_first = json_details::mem_skip_until_end_of_string<
215 ParseState::is_unchecked_input>( ParseState::exec_tag, ptr_first,
219 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
224 ++prime_bracket_count;
227 --prime_bracket_count;
228 if( prime_bracket_count == 0 ) {
232 result.last = ptr_first;
233 result.counter = cnt;
234 parse_state.first = ptr_first;
239 ++second_bracket_count;
242 --second_bracket_count;
246 while( *ptr_first !=
'\n' ) {