17 #include <daw/daw_attributes.h>
18 #include <daw/daw_likely.h>
19 #include <daw/daw_traits.h>
29 template<
typename ParseState>
30 DAW_ATTRIB_FLATINLINE
static constexpr
void
31 skip_comments_unchecked( ParseState &
parse_state ) {
35 parse_state.template move_to_next_of_unchecked<'\n'>( );
41 parse_state.template move_to_next_of_unchecked<'*'>( );
56 template<
typename ParseState>
57 DAW_ATTRIB_FLATINLINE
static constexpr
void
65 parse_state.template move_to_next_of_checked<'\n'>( );
73 parse_state.template move_to_next_of_checked<'*'>( );
92 template<
typename ParseState>
93 DAW_ATTRIB_FLATINLINE
static constexpr
void
95 if constexpr( ParseState::is_unchecked_input ) {
103 template<
typename ParseState>
104 DAW_ATTRIB_FLATINLINE
static constexpr
void
113 template<
typename ParseState>
114 DAW_ATTRIB_FLATINLINE
static constexpr
void
122 template<
typename ParseState>
123 DAW_ATTRIB_FLATINLINE
static constexpr
void
128 template<
char... keys,
typename ParseState>
129 DAW_ATTRIB_FLATINLINE
static constexpr
void
134 while( not parse_policy_details::in<keys...>(
parse_state.front( ) ) ) {
143 return c ==
'\0' or c ==
',' or c ==
']' or c ==
'}' or c ==
'#';
146 template<
char PrimLeft,
char PrimRight,
char SecLeft,
char SecRight,
148 DAW_ATTRIB_FLATINLINE
static constexpr ParseState
150 using CharT =
typename ParseState::CharT;
154 std::uint32_t prime_bracket_count = 1;
155 std::uint32_t second_bracket_count = 0;
158 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
161 if( *ptr_first == PrimLeft ) {
164 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
165 switch( *ptr_first ) {
171 if constexpr( traits::not_same_v<
typename ParseState::exec_tag_t,
174 ParseState::is_unchecked_input>( ParseState::exec_tag,
177 while( ptr_first < ptr_last and *ptr_first !=
'"' ) {
178 if( *ptr_first ==
'\\' ) {
180 if( ptr_first >= ptr_last ) {
191 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
196 ++prime_bracket_count;
199 --prime_bracket_count;
200 if( prime_bracket_count == 0 ) {
206 result.last = ptr_first;
207 result.counter = cnt;
213 ++second_bracket_count;
216 --second_bracket_count;
222 switch( *ptr_first ) {
225 while( ( ptr_last - ptr_first ) > 1 and *ptr_first !=
'\n' ) {
231 while( ( ptr_last - ptr_first ) >= 3 and *ptr_first !=
'*' and
232 *std::next( ptr_first ) !=
'/' ) {
244 ( second_bracket_count == 0 ),
248 result.last = ptr_first;
249 result.counter = cnt;
254 template<
char PrimLeft,
char PrimRight,
char SecLeft,
char SecRight,
256 DAW_ATTRIB_FLATINLINE
static constexpr ParseState
259 using CharT =
typename ParseState::CharT;
262 std::uint32_t prime_bracket_count = 1;
263 std::uint32_t second_bracket_count = 0;
265 if( *ptr_first == PrimLeft ) {
269 switch( *ptr_first ) {
275 if constexpr( traits::not_same_v<
typename ParseState::exec_tag_t,
278 ParseState::is_unchecked_input>( ParseState::exec_tag,
281 while( *ptr_first !=
'"' ) {
282 if( *ptr_first ==
'\\' ) {
290 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
295 ++prime_bracket_count;
298 --prime_bracket_count;
299 if( prime_bracket_count == 0 ) {
303 result.last = ptr_first;
304 result.counter = cnt;
310 ++second_bracket_count;
313 --second_bracket_count;
317 switch( *ptr_first ) {
320 while( *ptr_first !=
'\n' ) {
326 while( *ptr_first !=
'*' and *std::next( ptr_first ) !=
'/' ) {
#define daw_json_assert_weak(Bool,...)
Definition: daw_json_assert.h:189
#define daw_json_assert(Bool,...)
Definition: daw_json_assert.h:178
ParseState & parse_state
Definition: daw_json_parse_class.h:201
DAW_ATTRIB_FLATINLINE CharT * mem_skip_until_end_of_string(ExecTag const &tag, CharT *first, CharT *const last)
Definition: daw_not_const_ex_functions.h:360
Definition: daw_from_json.h:22
Definition: daw_json_exec_modes.h:19
#define DAW_JSON_VER
Definition: version.h:11