<
typename_CharType,
size_tN>
74 template<
typename_CharType,
size_tN>
79 template<
typename_CharType,
size_tN>
93 template<
typename_CharType,
size_tN>
131 template<
size_tlen>
132constexpr
auto extract_string(
size_tbegin, std::integral_constant<size_t, len>)
const 148 template<
size_t...Is>
152std::array<_CharType,
sizeof...(Is)>
arr= {_CharType(
m_parsed[begin + Is].detail) ... };
159 size_tpos_output = 0;
160 size_tpos_input = 0;
162 while( pos_input <
input.size() )
164_CharType next_c =
input[pos_input++];
165 if(pos_input ==
input.size() && (next_c ==
'$' ornext_c ==
'\\')) {
171 if(next_c ==
'$') {
176 if(next_c ==
'\\') {
188 for(
size_t i= 0;
i<
len; ++
i) {
189next_c =
input[pos_input +
i- 1];
201_CharType current =
input[dollar_pos];
203_CharType need_braces = 0;
226 if(current < '0' || current >
'9')
231 size_t_begin = dollar_pos;
233 size_t_end = _begin;
236 while(_end <
input.size() &&
input[_end] != need_braces)
239 while(_end <
input.size() &&
input[_end]>=
'0'&&
input[_end]<=
'9')
243 if((_end ==
input.size() && need_braces) || _begin == _end)
246 intgroup_number = -1;
247 if(need_braces == 0 || need_braces ==
'}')
250 if(need_braces && group_number < 0) {
252 size_t_len = _end - _begin;
259 if(need_braces == 0)
270 if(_end - _begin > 4)
275 while(_begin != _end) {
276 intc =
input[_begin++];
278 if(c < '0' || c >
'9')
301 template<
typename_CharType,
size_tN>
303 template<
typename_CharType,
size_tN>
306 template<
typename_CharType,
size_tN>
312 template<
typename_CharType,
size_tN, const compiled_regex<_CharType, N>& compiled>
317 ifconstexpr (compiled.real_size() == 0) {
321 returnx_build_next_action<0>(std::make_tuple());
325 template<
size_tbegin,
typename...TArgs>
328 ifconstexpr (begin >= compiled.real_size()) {
336 #if __cpp_nontype_template_args > 201411L 337constexpr
size_t len=
cmd.detail;
340 autonewcode = std::make_tuple(op);
341 autores = std::tuple_cat(tup, newcode);
342 returnx_build_next_action<begin+1+len>(res);
344static_assert(__cpp_nontype_template_args <= 201411L,
"group names are only allowed with C++-20 enabled");
349constexpr
size_tnext_end = compiled.find_end_string(begin);
350 autonewcode = std::make_tuple(compiled.extract_string(begin, std::integral_constant<size_t, next_end-begin>{}));
351 autores = std::tuple_cat(tup, newcode);
352 returnx_build_next_action<next_end>(res);
356 autores = std::tuple_cat(tup, newcode);
357 returnx_build_next_action<begin+1>(res);
359 ifconstexpr (ct::inline_bitset<
364 autonewcode = std::make_tuple(
cmd.cmd);
365 autores = std::tuple_cat(tup, newcode);
366 returnx_build_next_action<begin+1>(res);
375 template<ct_fixed_
string_input_param input>
380static_assert (
compiled.error_pos() == 0);
384 template<ct_fixed_
string_input_param input>
402 template<ct_fixed_
string_input_param input>
421 staticconstexpr
auto runtime= build_replace_runtime_actions<input>();
425static_assert(
size>0);
430 returnbuild_replace_runtime_actions<input>();
436 template<
typename_Context,
typename...TArgs>
439x_apply_all<0>(
ctx,
out);
442 template<
typename_Context,
size_tN = 0>
445std::basic_string_view subst = x_get_substitute<N>(
ctx,
runtime);
451 template<
size_t N,
typename_Context,
typename...TArgs>
454 ifconstexpr (
N<
size)
456constexpr
const auto& op = std::get<N>(
runtime);
457std::basic_string_view<char_type> subst = x_get_substitute<N>(
ctx, op);
459x_apply_all<N+1>(
ctx,
out);
463 template<
size_tpos,
typename_Context,
typename...TArgs>
466constexpr
const auto&
cmd= std::get<pos>(
runtime);
467 returnx_get_substitute<pos>(
ctx,
cmd);
470 template<
size_tpos,
size_tN,
typename_Context>
476 template<
size_tpos,
size_tN,
typename_Context>
479constexpr
const auto&
cmd= std::get<pos>(
runtime);
482 return ctx.template get<
cmd.m_name>();
485 template<
size_tpos,
typename_Context>
491 return ctx.template get<
cmd.m_number>();
494 template<
size_tpos,
typename_Context>
500 returnstd::basic_string_view<char_type>(
ctx.begin,
ctx.matched.begin());
503 returnstd::basic_string_view<char_type>(
ctx.matched.end(),
ctx.end);
506 returnstd::basic_string_view<char_type>(
ctx.begin,
ctx.end);
509 returnstd::basic_string_view<char_type>{};
512 returnstd::basic_string_view<char_type>{};
517 template<
typename_Input,
typename= _Input>
520 template<
typename...TArgs>
526 template<
typename_T>
529 template<
typename...TArgs>
535 template<
typename_Input>
549 using view_type= std::basic_string_view<typename output_type::value_type, typename output_type::traits_type>;
551static_assert(std::is_same_v<_Input, output_type> || std::is_constructible_v<output_type, _Input>);
574 template<
typename_T=_Input,
typename= std::enable_if_t<std::is_constructible_v<output_type, const _T&>, _T>>
600 template<
typename_Change,
typename= std::enable_if_t<std::is_assignable_v<output_type, _Change>>>
603 m_modified= std::forward<_Change>(new_value);
612 template<
typename...TArgs>
615 template<
typename...TArgs>
618 template<
typename...TArgs>
621 template<
typename_CharType>
typename std::decay_t< decltype(input)>::char_type char_type
static void apply_all(_Context &ctx, std::basic_string< char_type, TArgs... > &out)
static auto x_get_substitute(_Context &, const ct::fixed_string< char_type, N > &s)
static auto x_get_substitute(const _Context &ctx, const e_action &)
static auto x_get_substitute(_Context &ctx, const std::tuple< TArgs... > &)
static void x_apply_all(_Context &ctx, std::basic_string< char_type, TArgs... > &out)
static auto x_get_substitute(_Context &ctx, const group_name_op< char_type, N > &)
static constexpr size_t size
static auto x_get_substitute(const _Context &ctx, const group_number_op &)
static auto get_substitute(_Context &ctx)
static constexpr auto runtime
static constexpr bool is_single_action
constexpr const parsed_str_type & parsed() const
static constexpr int x_try_parse_number(const input_array_type &input, size_t _begin, size_t _end)
constexpr size_t error_pos() const
constexpr size_t find_end_string(size_t begin) const
constexpr size_t real_size() const
static constexpr action_type x_parse_slash(_CharType c)
constexpr const action_type & operator[](size_t i) const
std::array< action_type, N > parsed_str_type
constexpr compiled_regex()=default
constexpr compiled_regex(const input_array_type &input)
constexpr auto x_extract_string(size_t begin, std::index_sequence< Is... >) const -> ct::fixed_string< _CharType, sizeof...(Is)>
constexpr void x_parse(const input_array_type &input)
static constexpr action_type x_parse_dollar(const input_array_type &input, size_t &dollar_pos)
constexpr auto extract_string(size_t begin, std::integral_constant< size_t, len >) const -> ct::fixed_string< _CharType, len >
compiled_regex(int, const _CharType(&input)[N+1])
const output_type & cref_type
mutable_string(mutable_string &&)=default
std::optional< output_type > m_modified
typename DeduceMutableString< _Input >::output_type output_type
mutable_string & operator=(mutable_string &&)=default
bool operator==(const _T &v) const
std::basic_string_view< typename output_type::value_type, typename output_type::traits_type > view_type
mutable_string(const mutable_string &)=default
mutable_string & operator=(const mutable_string &)=default
view_type to_view() const
mutable_string(input_type orig)
mutable_string & operator=(_Change &&new_value)
static vector< string > arr
std::ofstream out("events_result.xml")
main entry point for tests
#define test(a, b, c, d, e)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
constexpr auto build_replace_runtime_actions()
mutable_string(const std::basic_string_view< TArgs... > &) -> mutable_string< std::basic_string_view< TArgs... >>
group_name_op(ct::fixed_string< _CharType, N >) -> group_name_op< _CharType, N >
compiled_regex(const _CharType(&)[N]) -> compiled_regex< _CharType, N-1 >
string_type::value_type char_type
The character type used by the parser.
const GenericPointer< typename T::ValueType > T2 value
static SLJIT_INLINE sljit_ins or(sljit_gpr dst, sljit_gpr src)
constexpr auto to_view() const -> std::basic_string_view< _CharType >
std::basic_string< TArgs... > output_type
std::basic_string< TArgs... > output_type
static constexpr auto build()
static constexpr auto x_build_next_action(const std::tuple< TArgs... > &tup)
static constexpr auto compiled
ct::fixed_string< _CharType, N > m_name
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4