17 #include <daw/daw_attributes.h>
18 #include <daw/daw_likely.h>
19 #include <daw/daw_traits.h>
24 #include <type_traits>
29 template<
typename ParseState>
30 DAW_ATTRIB_FLATINLINE
static constexpr
void
31 skip_comments_unchecked( ParseState &
parse_state ) {
34 parse_state.template move_to_next_of_unchecked<'\n'>( );
39 template<
typename ParseState>
40 DAW_ATTRIB_FLATINLINE
static constexpr
void
44 parse_state.template move_to_next_of_checked<'\n'>( );
51 template<
typename ParseState>
52 DAW_ATTRIB_FLATINLINE
static constexpr
void
54 if constexpr( ParseState::is_unchecked_input ) {
62 template<
typename ParseState>
63 DAW_ATTRIB_FLATINLINE
static constexpr
void
72 template<
typename ParseState>
73 DAW_ATTRIB_FLATINLINE
static constexpr
void
81 template<
typename ParseState>
82 DAW_ATTRIB_FLATINLINE
static constexpr
void
87 template<
char... keys,
typename ParseState>
88 DAW_ATTRIB_FLATINLINE
static constexpr
void
94 while( not parse_policy_details::in<keys...>(
parse_state.front( ) ) ) {
103 return c ==
'\0' or c ==
',' or c ==
']' or c ==
'}' or c ==
'#';
106 template<
char PrimLeft,
char PrimRight,
char SecLeft,
char SecRight,
108 DAW_ATTRIB_FLATINLINE
static constexpr ParseState
110 using CharT =
typename ParseState::CharT;
114 std::uint32_t prime_bracket_count = 1;
115 std::uint32_t second_bracket_count = 0;
118 if( DAW_UNLIKELY( ptr_first >= ptr_last ) ) {
121 if( *ptr_first == PrimLeft ) {
124 while( DAW_LIKELY( ptr_first < ptr_last ) ) {
126 switch( *ptr_first ) {
132 if constexpr( traits::not_same_v<
typename ParseState::exec_tag_t,
135 ParseState::is_unchecked_input>( ParseState::exec_tag,
138 while( DAW_LIKELY( ptr_first < ptr_last ) and
139 *ptr_first !=
'"' ) {
140 if( *ptr_first ==
'\\' ) {
142 if( ptr_first >= ptr_last ) {
153 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
158 ++prime_bracket_count;
161 --prime_bracket_count;
162 if( prime_bracket_count == 0 ) {
168 result.last = ptr_first;
169 result.counter = cnt;
175 ++second_bracket_count;
178 --second_bracket_count;
182 while( ptr_first < ptr_last and *ptr_first !=
'\n' ) {
185 if( ptr_first < ptr_last ) {
193 ( second_bracket_count == 0 ),
197 result.last = ptr_first;
198 result.counter = cnt;
203 template<
char PrimLeft,
char PrimRight,
char SecLeft,
char SecRight,
205 DAW_ATTRIB_FLATINLINE
static constexpr ParseState
208 using CharT =
typename ParseState::CharT;
211 std::uint32_t prime_bracket_count = 1;
212 std::uint32_t second_bracket_count = 0;
214 if( *ptr_first == PrimLeft ) {
218 switch( *ptr_first ) {
224 if constexpr( traits::not_same_v<
typename ParseState::exec_tag_t,
227 ParseState::is_unchecked_input>( ParseState::exec_tag,
230 while( *ptr_first !=
'"' ) {
231 if( *ptr_first ==
'\\' ) {
239 if( prime_bracket_count == 1 and second_bracket_count == 0 ) {
244 ++prime_bracket_count;
247 --prime_bracket_count;
248 if( prime_bracket_count == 0 ) {
252 result.last = ptr_first;
253 result.counter = cnt;
259 ++second_bracket_count;
262 --second_bracket_count;
266 while( *ptr_first !=
'\n' ) {
#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