diff --git a/.clang-format b/.clang-format index d722c5c..7e1c343 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,8 @@ --- +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: Right AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true AllowShortBlocksOnASingleLine: Always AllowShortCompoundRequirementOnASingleLine: true AllowShortEnumsOnASingleLine: true diff --git a/include/ctre.hpp b/include/ctre.hpp index b771bd4..132ee4a 100644 --- a/include/ctre.hpp +++ b/include/ctre.hpp @@ -243,11 +243,12 @@ namespace ctll { struct length_value_t { uint32_t value; - uint8_t length; + uint8_t length; }; constexpr length_value_t length_and_value_of_utf8_code_point( - uint8_t first_unit) noexcept { + uint8_t first_unit + ) noexcept { if ((first_unit & 0b1000'0000) == 0b0000'0000) return {static_cast(first_unit), 1}; else if ((first_unit & 0b1110'0000) == 0b1100'0000) @@ -264,8 +265,8 @@ namespace ctll { return {0, 0}; } - constexpr char32_t value_of_trailing_utf8_code_point(uint8_t unit, - bool& correct) noexcept { + constexpr char32_t + value_of_trailing_utf8_code_point(uint8_t unit, bool& correct) noexcept { if ((unit & 0b1100'0000) == 0b1000'0000) return unit & 0b0011'1111; else { @@ -275,7 +276,8 @@ namespace ctll { } constexpr length_value_t length_and_value_of_utf16_code_point( - uint16_t first_unit) noexcept { + uint16_t first_unit + ) noexcept { if ((first_unit & 0b1111110000000000) == 0b1101'1000'0000'0000) return {static_cast(first_unit & 0b0000001111111111), 2}; else @@ -289,8 +291,8 @@ namespace ctll { template struct fixed_string { char32_t content[N] = {}; - size_t real_size {0}; - bool correct_flag {true}; + size_t real_size {0}; + bool correct_flag {true}; template constexpr fixed_string(construct_from_pointer_t, const T* input) noexcept { @@ -437,11 +439,11 @@ namespace ctll { real_size = other.real_size; correct_flag = other.correct_flag; } - constexpr bool correct() const noexcept { return correct_flag; } - constexpr size_t size() const noexcept { return real_size; } + constexpr bool correct() const noexcept { return correct_flag; } + constexpr size_t size() const noexcept { return real_size; } constexpr const char32_t* begin() const noexcept { return content; } constexpr const char32_t* end() const noexcept { return content + size(); } - constexpr char32_t operator[](size_t i) const noexcept { + constexpr char32_t operator[](size_t i) const noexcept { return content[i]; } template @@ -466,11 +468,11 @@ namespace ctll { constexpr fixed_string(const T*) noexcept {} constexpr fixed_string(std::initializer_list) noexcept {} constexpr fixed_string(const fixed_string&) noexcept {} - constexpr bool correct() const noexcept { return true; } - constexpr size_t size() const noexcept { return 0; } + constexpr bool correct() const noexcept { return true; } + constexpr size_t size() const noexcept { return 0; } constexpr const char32_t* begin() const noexcept { return empty; } constexpr const char32_t* end() const noexcept { return empty + size(); } - constexpr char32_t operator[](size_t) const noexcept { return 0; } + constexpr char32_t operator[](size_t) const noexcept { return 0; } constexpr operator std::basic_string_view() const noexcept { return std::basic_string_view {empty, 0}; } @@ -581,8 +583,8 @@ namespace ctll { // concat two lists together left to right template - constexpr auto concat(list, - list) noexcept -> list { + constexpr auto concat(list, list) noexcept + -> list { return {}; } @@ -603,7 +605,7 @@ namespace ctll { template struct list_pop_pair { Front front {}; - List list {}; + List list {}; constexpr list_pop_pair() = default; }; @@ -632,15 +634,15 @@ namespace ctll { template struct rotate_item { template - friend constexpr auto operator+(list, - rotate_item) noexcept -> list { + friend constexpr auto operator+(list, rotate_item) noexcept + -> list { return {}; } }; template - constexpr auto rotate(list) -> decltype((list<> {} + ... + - rotate_item {})) { + constexpr auto rotate(list) + -> decltype((list<> {} + ... + rotate_item {})) { return {}; } @@ -654,8 +656,8 @@ namespace ctll { template struct wrapper { template - friend constexpr auto operator+(list, - wrapper) -> list; + friend constexpr auto operator+(list, wrapper) + -> list; }; static constexpr auto check(T) { return std::true_type {}; } @@ -802,8 +804,9 @@ namespace ctll { template ::value>> constexpr inline neg_set(term) noexcept; #else - template > + template < + auto V, + typename = std::enable_if_t> constexpr inline neg_set(term) noexcept; #endif }; @@ -825,8 +828,9 @@ namespace ctll { // from the terminal => pop_input template static constexpr auto rule(Expected, term) - -> std::enable_if_t>, - ctll::pop_input>; + -> std::enable_if_t< + std::is_constructible_v>, + ctll::pop_input>; // empty stack and empty input means we are accepting static constexpr auto rule(empty_stack_symbol, epsilon) -> ctll::accept; @@ -861,15 +865,13 @@ namespace ctll { using Actions::apply; // allow empty_subject to exists template - constexpr static auto apply(Action, - term, - empty_subject) -> empty_subject { + constexpr static auto apply(Action, term, empty_subject) + -> empty_subject { return {}; } template - constexpr static auto apply(Action, - epsilon, - empty_subject) -> empty_subject { + constexpr static auto apply(Action, epsilon, empty_subject) + -> empty_subject { return {}; } }; @@ -903,16 +905,18 @@ namespace ctll { using index_placeholder = placeholder; #if CTLL_CNTTP_COMPILER_CHECK - template + template < + typename Grammar, + ctll::fixed_string input, + typename ActionSelector = empty_actions, + bool IgnoreUnknownActions = false> struct parser { // in c++20 #else - template + template < + typename Grammar, + const auto& input, + typename ActionSelector = empty_actions, + bool IgnoreUnknownActions = false> struct parser { #endif @@ -926,9 +930,10 @@ namespace ctll { static constexpr auto _input = input; // everyone else #endif - using Actions = ctll::conditional, - identity>; + using Actions = ctll::conditional< + IgnoreUnknownActions, + ignore_unknown, + identity>; using grammar = augment_grammar; template @@ -970,7 +975,8 @@ namespace ctll { if constexpr (Pos < input.size()) { constexpr auto value = input[Pos]; if constexpr (value <= static_cast( - (std::numeric_limits::max)())) { + (std::numeric_limits::max)() + )) { return term(value)> {}; } else { return term {}; @@ -989,7 +995,8 @@ namespace ctll { } else if constexpr ((Pos - 1) < input.size()) { constexpr auto value = input[Pos - 1]; if constexpr (value <= static_cast( - (std::numeric_limits::max)())) { + (std::numeric_limits::max)() + )) { return term(value)> {}; } else { return term {}; @@ -1000,97 +1007,90 @@ namespace ctll { } // if rule is accept => return true and subject template - static constexpr auto move(ctll::accept, - Terminal, - Stack, - Subject) noexcept { - return typename parser:: + static constexpr auto + move(ctll::accept, Terminal, Stack, Subject) noexcept { + return typename parser< + Grammar, _input, ActionSelector, IgnoreUnknownActions>:: template results(); } // if rule is reject => return false and subject template - static constexpr auto move(ctll::reject, - Terminal, - Stack, - Subject) noexcept { - return typename parser:: + static constexpr auto + move(ctll::reject, Terminal, Stack, Subject) noexcept { + return typename parser< + Grammar, _input, ActionSelector, IgnoreUnknownActions>:: template results(); } // if rule is pop_input => move to next character template - static constexpr auto move(ctll::pop_input, - Terminal, - Stack, - Subject) noexcept { - return typename parser:: + static constexpr auto + move(ctll::pop_input, Terminal, Stack, Subject) noexcept { + return typename parser< + Grammar, _input, ActionSelector, IgnoreUnknownActions>:: template results(); } // if rule is string => push it to the front of stack - template - static constexpr auto move(push string, - Terminal, - Stack stack, - Subject subject) noexcept { + template < + size_t Pos, + typename... Content, + typename Terminal, + typename Stack, + typename Subject> + static constexpr auto move( + push string, + Terminal, + Stack stack, + Subject subject + ) noexcept { return decide(push_front(string, stack), subject); } // if rule is epsilon (empty string) => continue template - static constexpr auto move(epsilon, - Terminal, - Stack stack, - Subject subject) noexcept { + static constexpr auto + move(epsilon, Terminal, Stack stack, Subject subject) noexcept { return decide(stack, subject); } // if rule is string with current character at the beginning (term) => // move to next character and push string without the character (quick // LL(1)) - template - static constexpr auto move(push, Content...>, - term, - Stack stack, - Subject) noexcept { + template < + size_t Pos, + auto V, + typename... Content, + typename Stack, + typename Subject> + static constexpr auto + move(push, Content...>, term, Stack stack, Subject) noexcept { constexpr auto local_input = input; - return typename parser:: - template results(), stack)), - Subject, decision::undecided>(); + return typename parser< + Grammar, local_input, ActionSelector, IgnoreUnknownActions>:: + template results< + Pos + 1, decltype(push_front(list(), stack)), Subject, + decision::undecided>(); } // if rule is string with any character at the beginning (compatible with // current term) => move to next character and push string without the // character (quick LL(1)) - template - static constexpr auto move(push, - term, - Stack stack, - Subject) noexcept { + template < + size_t Pos, + auto V, + typename... Content, + auto T, + typename Stack, + typename Subject> + static constexpr auto + move(push, term, Stack stack, Subject) noexcept { constexpr auto local_input = input; - return typename parser:: - template results(), stack)), - Subject, decision::undecided>(); + return typename parser< + Grammar, local_input, ActionSelector, IgnoreUnknownActions>:: + template results< + Pos + 1, decltype(push_front(list(), stack)), Subject, + decision::undecided>(); } // decide if we need to take action or move template - static constexpr auto decide(Stack previous_stack, - Subject previous_subject) noexcept { + static constexpr auto + decide(Stack previous_stack, Subject previous_subject) noexcept { // each call means we pop something from stack auto top_symbol = decltype(ctll::front(previous_stack, empty_stack_symbol()))(); @@ -1100,13 +1100,14 @@ namespace ctll { // in case top_symbol is action type (apply it on previous subject and get // new one) if constexpr (std::is_base_of_v) { - auto subject = Actions::apply(top_symbol, get_previous_term(), - previous_subject); + auto subject = Actions::apply( + top_symbol, get_previous_term(), previous_subject + ); // in case that semantic action is error => reject input if constexpr (std::is_same_v) { - return typename parser:: + return typename parser< + Grammar, _input, ActionSelector, IgnoreUnknownActions>:: template results(); } else { return decide(stack, subject); @@ -1121,21 +1122,22 @@ namespace ctll { // trampolines with folded expression template - static constexpr auto trampoline_decide( - Subject, - std::index_sequence) noexcept { + static constexpr auto + trampoline_decide(Subject, std::index_sequence) noexcept { // parse everything for first char and than for next and next ... // Pos+1 is needed as we want to finish calculation with epsilons on stack - auto v = (decide<0, typename grammar::start_stack, Subject>({}, {}) + - ... + index_placeholder()); + auto v = + (decide<0, typename grammar::start_stack, Subject>({}, {}) + ... + + index_placeholder()); return v; } template static constexpr auto trampoline_decide(Subject subject = {}) noexcept { // there will be no recursion, just sequence long as the input - return trampoline_decide(subject, - std::make_index_sequence()); + return trampoline_decide( + subject, std::make_index_sequence() + ); } template @@ -1291,325 +1293,186 @@ namespace ctre { struct start_lookbehind_positive : ctll::action {}; // (q)LL1 function: - using _others = ctll::neg_set<'!', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '-', - '.', - '/', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '[', - '\\', - '0', - '\"', - ']', - '^', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>; + using _others = ctll::neg_set< + '!', + '$', + '\x28', + '\x29', + '*', + '+', + ',', + '-', + '.', + '/', + ':', + '<', + '=', + '>', + '?', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + '[', + '\\', + '0', + '\"', + ']', + '^', + '_', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + '\x7B', + '|', + '\x7D', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9'>; static constexpr auto rule(s, ctll::term<'\\'>) -> ctll::push; static constexpr auto rule(s, ctll::term<'['>) -> ctll::push; - static constexpr auto rule(s, ctll::term<'\x28'>) - -> ctll::push; + static constexpr auto rule(s, ctll::term<'\x28'>) -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + content2>; static constexpr auto rule(s, ctll::term<'^'>) -> ctll:: push; static constexpr auto rule(s, ctll::term<'$'>) -> ctll:: push; - static constexpr auto rule(s, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll:: - push; - static constexpr auto rule(s, _others) - -> ctll:: - push; - static constexpr auto rule(s, ctll::term<'.'>) - -> ctll::push; + static constexpr auto + rule(s, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll:: + push; + static constexpr auto rule( + s, + _others + ) -> ctll::push; + static constexpr auto rule(s, ctll::term<'.'>) -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + content2>; static constexpr auto rule(s, ctll::term<'|'>) -> ctll::push; static constexpr auto rule(s, ctll::epsilon) -> ctll::push; - static constexpr auto rule(s, - ctll::set<'\x29', '*', '+', '?', '\x7B', '\x7D'>) - -> ctll::reject; + static constexpr auto + rule(s, ctll::set<'\x29', '*', '+', '?', '\x7B', '\x7D'>) + -> ctll::reject; - static constexpr auto rule(a, - ctll::term<'\\'>) -> ctll::push; + static constexpr auto rule(a, ctll::term<'\\'>) -> ctll::push< + ctll::anything, + backslash, + repeat, + string2, + content2, + make_alternate>; static constexpr auto rule(a, ctll::term<'['>) -> ctll:: push; - static constexpr auto rule(a, ctll::term<'\x28'>) - -> ctll::push; - static constexpr auto rule(a, - ctll::term<'^'>) -> ctll::push; - static constexpr auto rule(a, - ctll::term<'$'>) -> ctll::push; - static constexpr auto rule(a, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::push; - static constexpr auto rule(a, _others) -> ctll::push; - static constexpr auto rule(a, ctll::term<'.'>) - -> ctll::push; + static constexpr auto rule(a, ctll::term<'\x28'>) -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + content2, + make_alternate>; + static constexpr auto rule(a, ctll::term<'^'>) -> ctll::push< + ctll::anything, + push_assert_begin, + repeat, + string2, + content2, + make_alternate>; + static constexpr auto rule(a, ctll::term<'$'>) -> ctll::push< + ctll::anything, + push_assert_end, + repeat, + string2, + content2, + make_alternate>; + static constexpr auto + rule(a, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + push_character, + repeat, + string2, + content2, + make_alternate>; + static constexpr auto rule(a, _others) -> ctll::push< + ctll::anything, + push_character, + repeat, + string2, + content2, + make_alternate>; + static constexpr auto rule(a, ctll::term<'.'>) -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + content2, + make_alternate>; static constexpr auto rule(a, ctll::term<'\x29'>) -> ctll::push; static constexpr auto rule(a, ctll::epsilon) @@ -1644,24 +1507,25 @@ namespace ctre { -> ctll::push; static constexpr auto rule(backslash, ctll::term<'w'>) -> ctll::push; - static constexpr auto rule( - backslash, - ctll::set<'1', '2', '3', '4', '5', '6', '7', '8', '9'>) - -> ctll::push; + static constexpr auto + rule(backslash, ctll::set<'1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; static constexpr auto rule(backslash, ctll::term<'g'>) -> ctll::push, m>; static constexpr auto rule(backslash, ctll::term<'p'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property>; + -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property>; static constexpr auto rule(backslash, ctll::term<'P'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property_negative>; + -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property_negative>; static constexpr auto rule(backslash, ctll::term<'u'>) -> ctll::push; static constexpr auto rule(backslash, ctll::term<'x'>) @@ -1672,27 +1536,9 @@ namespace ctre { -> ctll::push; static constexpr auto rule(backslash, ctll::term<'Z'>) -> ctll::push; - static constexpr auto rule(backslash, - ctll::set<'$', - '\x28', - '\x29', - '*', - '+', - '-', - '.', - '/', - '<', - '>', - '?', - '[', - '\\', - '\"', - ']', - '^', - '\x7B', - '|', - '\x7D'>) - -> ctll::push; + static constexpr auto + rule(backslash, ctll::set<'$', '\x28', '\x29', '*', '+', '-', '.', '/', '<', '>', '?', '[', '\\', '\"', ']', '^', '\x7B', '|', '\x7D'>) + -> ctll::push; static constexpr auto rule(backslash, ctll::term<'a'>) -> ctll::push; static constexpr auto rule(backslash, ctll::term<'e'>) @@ -1716,27 +1562,9 @@ namespace ctre { -> ctll::push; static constexpr auto rule(backslash_range, ctll::term<'x'>) -> ctll::push; - static constexpr auto rule(backslash_range, - ctll::set<'$', - '\x28', - '\x29', - '*', - '+', - '-', - '.', - '/', - '<', - '>', - '?', - '[', - '\\', - '\"', - ']', - '^', - '\x7B', - '|', - '\x7D'>) - -> ctll::push; + static constexpr auto + rule(backslash_range, ctll::set<'$', '\x28', '\x29', '*', '+', '-', '.', '/', '<', '>', '?', '[', '\\', '\"', ']', '^', '\x7B', '|', '\x7D'>) + -> ctll::push; static constexpr auto rule(backslash_range, ctll::term<'a'>) -> ctll::push; static constexpr auto rule(backslash_range, ctll::term<'e'>) @@ -1752,405 +1580,205 @@ namespace ctre { static constexpr auto rule(backslash_range, ctll::term<'t'>) -> ctll::push; - static constexpr auto rule(block, ctll::term<'\\'>) - -> ctll::push>; - static constexpr auto rule(block, ctll::term<'['>) - -> ctll::push>; + static constexpr auto rule(block, ctll::term<'\\'>) -> ctll::push< + ctll::anything, + backslash, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(block, ctll::term<'['>) -> ctll::push< + ctll::anything, + c, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; static constexpr auto rule(block, ctll::term<'?'>) -> ctll::push; static constexpr auto rule(block, ctll::term<'\x28'>) - -> ctll::push>; - static constexpr auto rule(block, ctll::term<'^'>) - -> ctll::push>; - static constexpr auto rule(block, ctll::term<'$'>) - -> ctll::push>; - static constexpr auto rule(block, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push>; - static constexpr auto rule(block, - _others) -> ctll::push>; + -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(block, ctll::term<'^'>) -> ctll::push< + ctll::anything, + push_assert_begin, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(block, ctll::term<'$'>) -> ctll::push< + ctll::anything, + push_assert_end, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto + rule(block, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + push_character, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(block, _others) -> ctll::push< + ctll::anything, + push_character, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; static constexpr auto rule(block, ctll::term<'.'>) - -> ctll::push>; - static constexpr auto rule(block, ctll::term<'|'>) - -> ctll::push>; + -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + content2, + make_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(block, ctll::term<'|'>) -> ctll::push< + ctll::anything, + push_empty, + content, + make_alternate, + make_capture, + ctll::term<'\x29'>>; static constexpr auto rule(block, ctll::term<'\x29'>) -> ctll::push; static constexpr auto rule(block, ctll::set<'*', '+', '\x7B', '\x7D'>) -> ctll::reject; - static constexpr auto rule(block_name2, - ctll::set<'>', '\x7D'>) -> ctll::epsilon; - static constexpr auto rule(block_name2, - ctll::set<'0', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; + static constexpr auto rule(block_name2, ctll::set<'>', '\x7D'>) + -> ctll::epsilon; + static constexpr auto rule(block_name2, ctll::set<'0', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) -> ctll:: + push; - static constexpr auto rule(c, - ctll::term<'['>) -> ctll::push, - i, - range, - set_start, - set2b, - set_make, - ctll::term<']'>>; - static constexpr auto rule(c, - ctll::term<'\\'>) -> ctll::push>; - static constexpr auto rule(c, - ctll::set<'!', - '0', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '.', - '/', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::push>; - static constexpr auto rule(c, _others) -> ctll::push>; + static constexpr auto rule(c, ctll::term<'['>) -> ctll::push< + ctll::anything, + ctll::term<':'>, + i, + range, + set_start, + set2b, + set_make, + ctll::term<']'>>; + static constexpr auto rule(c, ctll::term<'\\'>) -> ctll::push< + ctll::anything, + e, + set_start, + set2b, + set_make, + ctll::term<']'>>; + static constexpr auto + rule(c, ctll::set<'!', '0', '$', '\x28', '\x29', '*', '+', ',', '.', '/', ':', '<', '=', '>', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\x7B', '|', '\x7D', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + push_character, + range, + set_start, + set2b, + set_make, + ctll::term<']'>>; + static constexpr auto rule(c, _others) -> ctll::push< + ctll::anything, + push_character, + range, + set_start, + set2b, + set_make, + ctll::term<']'>>; static constexpr auto rule(c, ctll::term<'^'>) -> ctll:: push>; static constexpr auto rule(c, ctll::set<'-', ']'>) -> ctll::reject; static constexpr auto rule(class_named_name, ctll::term<'x'>) - -> ctll::push, - ctll::term<'i'>, - ctll::term<'g'>, - ctll::term<'i'>, - ctll::term<'t'>, - class_named_xdigit>; + -> ctll::push< + ctll::anything, + ctll::term<'d'>, + ctll::term<'i'>, + ctll::term<'g'>, + ctll::term<'i'>, + ctll::term<'t'>, + class_named_xdigit>; static constexpr auto rule(class_named_name, ctll::term<'d'>) - -> ctll::push, - ctll::term<'g'>, - ctll::term<'i'>, - ctll::term<'t'>, - class_named_digit>; + -> ctll::push< + ctll::anything, + ctll::term<'i'>, + ctll::term<'g'>, + ctll::term<'i'>, + ctll::term<'t'>, + class_named_digit>; static constexpr auto rule(class_named_name, ctll::term<'b'>) - -> ctll::push, - ctll::term<'a'>, - ctll::term<'n'>, - ctll::term<'k'>, - class_named_blank>; + -> ctll::push< + ctll::anything, + ctll::term<'l'>, + ctll::term<'a'>, + ctll::term<'n'>, + ctll::term<'k'>, + class_named_blank>; static constexpr auto rule(class_named_name, ctll::term<'c'>) - -> ctll::push, - ctll::term<'t'>, - ctll::term<'r'>, - ctll::term<'l'>, - class_named_cntrl>; - static constexpr auto rule(class_named_name, - ctll::term<'w'>) -> ctll::push, - ctll::term<'r'>, - ctll::term<'d'>, - class_named_word>; + -> ctll::push< + ctll::anything, + ctll::term<'n'>, + ctll::term<'t'>, + ctll::term<'r'>, + ctll::term<'l'>, + class_named_cntrl>; + static constexpr auto rule(class_named_name, ctll::term<'w'>) + -> ctll::push< + ctll::anything, + ctll::term<'o'>, + ctll::term<'r'>, + ctll::term<'d'>, + class_named_word>; static constexpr auto rule(class_named_name, ctll::term<'l'>) - -> ctll::push, - ctll::term<'w'>, - ctll::term<'e'>, - ctll::term<'r'>, - class_named_lower>; + -> ctll::push< + ctll::anything, + ctll::term<'o'>, + ctll::term<'w'>, + ctll::term<'e'>, + ctll::term<'r'>, + class_named_lower>; static constexpr auto rule(class_named_name, ctll::term<'s'>) - -> ctll::push, - ctll::term<'a'>, - ctll::term<'c'>, - ctll::term<'e'>, - class_named_space>; + -> ctll::push< + ctll::anything, + ctll::term<'p'>, + ctll::term<'a'>, + ctll::term<'c'>, + ctll::term<'e'>, + class_named_space>; static constexpr auto rule(class_named_name, ctll::term<'u'>) - -> ctll::push, - ctll::term<'p'>, - ctll::term<'e'>, - ctll::term<'r'>, - class_named_upper>; + -> ctll::push< + ctll::anything, + ctll::term<'p'>, + ctll::term<'p'>, + ctll::term<'e'>, + ctll::term<'r'>, + class_named_upper>; static constexpr auto rule(class_named_name, ctll::term<'g'>) - -> ctll::push, - ctll::term<'a'>, - ctll::term<'p'>, - ctll::term<'h'>, - class_named_graph>; + -> ctll::push< + ctll::anything, + ctll::term<'r'>, + ctll::term<'a'>, + ctll::term<'p'>, + ctll::term<'h'>, + class_named_graph>; static constexpr auto rule(class_named_name, ctll::term<'a'>) -> ctll::push; static constexpr auto rule(class_named_name, ctll::term<'p'>) @@ -2165,217 +1793,78 @@ namespace ctre { -> ctll::push; static constexpr auto rule(content, ctll::term<'['>) -> ctll::push; - static constexpr auto rule(content, ctll::term<'\x28'>) - -> ctll::push; + static constexpr auto rule(content, ctll::term<'\x28'>) -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + content2>; static constexpr auto rule(content, ctll::term<'^'>) -> ctll:: push; static constexpr auto rule(content, ctll::term<'$'>) -> ctll:: push; - static constexpr auto rule(content, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll:: - push; - static constexpr auto rule(content, _others) - -> ctll:: - push; - static constexpr auto rule(content, ctll::term<'.'>) - -> ctll::push; + static constexpr auto + rule(content, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll:: + push; static constexpr auto rule( content, - ctll::set<'\x29', '*', '+', '?', '\x7B', '|', '\x7D'>) -> ctll::reject; + _others + ) -> ctll::push; + static constexpr auto rule(content, ctll::term<'.'>) + -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + content2>; + static constexpr auto + rule(content, ctll::set<'\x29', '*', '+', '?', '\x7B', '|', '\x7D'>) + -> ctll::reject; static constexpr auto rule(content_in_capture, ctll::term<'\\'>) -> ctll::push; static constexpr auto rule(content_in_capture, ctll::term<'['>) -> ctll::push; static constexpr auto rule(content_in_capture, ctll::term<'\x28'>) - -> ctll::push; + -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + content2>; static constexpr auto rule(content_in_capture, ctll::term<'^'>) -> ctll:: push; static constexpr auto rule(content_in_capture, ctll::term<'$'>) -> ctll:: push; - static constexpr auto rule(content_in_capture, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll:: - push; - static constexpr auto rule(content_in_capture, _others) - -> ctll:: - push; + static constexpr auto + rule(content_in_capture, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll:: + push; + static constexpr auto rule( + content_in_capture, + _others + ) -> ctll::push; static constexpr auto rule(content_in_capture, ctll::term<'.'>) - -> ctll::push; + -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + content2>; static constexpr auto rule(content_in_capture, ctll::term<'|'>) -> ctll::push; - static constexpr auto rule(content_in_capture, - ctll::term<'\x29'>) -> ctll::push; - static constexpr auto rule(content_in_capture, - ctll::set<'*', '+', '?', '\x7B', '\x7D'>) - -> ctll::reject; + static constexpr auto rule(content_in_capture, ctll::term<'\x29'>) + -> ctll::push; + static constexpr auto + rule(content_in_capture, ctll::set<'*', '+', '?', '\x7B', '\x7D'>) + -> ctll::reject; static constexpr auto rule(d, ctll::term<'i'>) -> ctll::push; @@ -2387,32 +1876,32 @@ namespace ctre { -> ctll::push; static constexpr auto rule(d, ctll::term<'<'>) -> ctll::push; - static constexpr auto rule(d, ctll::term<':'>) - -> ctll::push>; - static constexpr auto rule(d, ctll::term<'>'>) - -> ctll::push>; - static constexpr auto rule(d, ctll::term<'!'>) - -> ctll::push>; - static constexpr auto rule(d, ctll::term<'='>) - -> ctll::push>; + static constexpr auto rule(d, ctll::term<':'>) -> ctll::push< + ctll::anything, + reset_capture, + content_in_capture, + ctll::term<'\x29'>>; + static constexpr auto rule(d, ctll::term<'>'>) -> ctll::push< + ctll::anything, + reset_capture, + start_atomic, + content_in_capture, + make_atomic, + ctll::term<'\x29'>>; + static constexpr auto rule(d, ctll::term<'!'>) -> ctll::push< + ctll::anything, + reset_capture, + start_lookahead_negative, + content_in_capture, + look_finish, + ctll::term<'\x29'>>; + static constexpr auto rule(d, ctll::term<'='>) -> ctll::push< + ctll::anything, + reset_capture, + start_lookahead_positive, + content_in_capture, + look_finish, + ctll::term<'\x29'>>; static constexpr auto rule(e, ctll::term<'d'>) -> ctll::push; @@ -2436,43 +1925,25 @@ namespace ctre { -> ctll::push; static constexpr auto rule(e, ctll::term<'w'>) -> ctll::push; - static constexpr auto rule(e, ctll::term<'p'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property>; - static constexpr auto rule(e, ctll::term<'P'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property_negative>; + static constexpr auto rule(e, ctll::term<'p'>) -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property>; + static constexpr auto rule(e, ctll::term<'P'>) -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property_negative>; static constexpr auto rule(e, ctll::term<'u'>) -> ctll::push; static constexpr auto rule(e, ctll::term<'x'>) -> ctll::push; - static constexpr auto rule(e, - ctll::set<'$', - '\x28', - '\x29', - '*', - '+', - '-', - '.', - '/', - '<', - '>', - '?', - '[', - '\\', - '\"', - ']', - '^', - '\x7B', - '|', - '\x7D'>) - -> ctll::push; + static constexpr auto + rule(e, ctll::set<'$', '\x28', '\x29', '*', '+', '-', '.', '/', '<', '>', '?', '[', '\\', '\"', ']', '^', '\x7B', '|', '\x7D'>) + -> ctll::push; static constexpr auto rule(e, ctll::term<'a'>) -> ctll::push; static constexpr auto rule(e, ctll::term<'e'>) @@ -2510,43 +1981,25 @@ namespace ctre { -> ctll::push; static constexpr auto rule(f, ctll::term<'w'>) -> ctll::push; - static constexpr auto rule(f, ctll::term<'p'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property>; - static constexpr auto rule(f, ctll::term<'P'>) - -> ctll::push, - property_name, - ctll::term<'\x7D'>, - make_property_negative>; + static constexpr auto rule(f, ctll::term<'p'>) -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property>; + static constexpr auto rule(f, ctll::term<'P'>) -> ctll::push< + ctll::anything, + ctll::term<'\x7B'>, + property_name, + ctll::term<'\x7D'>, + make_property_negative>; static constexpr auto rule(f, ctll::term<'u'>) -> ctll::push; static constexpr auto rule(f, ctll::term<'x'>) -> ctll::push; - static constexpr auto rule(f, - ctll::set<'$', - '\x28', - '\x29', - '*', - '+', - '-', - '.', - '/', - '<', - '>', - '?', - '[', - '\\', - '\"', - ']', - '^', - '\x7B', - '|', - '\x7D'>) - -> ctll::push; + static constexpr auto + rule(f, ctll::set<'$', '\x28', '\x29', '*', '+', '-', '.', '/', '<', '>', '?', '[', '\\', '\"', ']', '^', '\x7B', '|', '\x7D'>) + -> ctll::push; static constexpr auto rule(f, ctll::term<'a'>) -> ctll::push; static constexpr auto rule(f, ctll::term<'e'>) @@ -2562,142 +2015,121 @@ namespace ctre { static constexpr auto rule(f, ctll::term<'t'>) -> ctll::push; - static constexpr auto rule(g, ctll::term<'s'>) - -> ctll::push, - ctll::term<'i'>, - ctll::term<'i'>, - class_named_ascii>; + static constexpr auto rule(g, ctll::term<'s'>) -> ctll::push< + ctll::anything, + ctll::term<'c'>, + ctll::term<'i'>, + ctll::term<'i'>, + class_named_ascii>; static constexpr auto rule(g, ctll::term<'l'>) -> ctll::push; - static constexpr auto rule(h, ctll::term<'r'>) - -> ctll::push, - ctll::term<'n'>, - ctll::term<'t'>, - class_named_print>; - static constexpr auto rule(h, ctll::term<'u'>) - -> ctll::push, - ctll::term<'c'>, - ctll::term<'t'>, - class_named_punct>; + static constexpr auto rule(h, ctll::term<'r'>) -> ctll::push< + ctll::anything, + ctll::term<'i'>, + ctll::term<'n'>, + ctll::term<'t'>, + class_named_print>; + static constexpr auto rule(h, ctll::term<'u'>) -> ctll::push< + ctll::anything, + ctll::term<'n'>, + ctll::term<'c'>, + ctll::term<'t'>, + class_named_punct>; - static constexpr auto rule(hexdec_repeat, - ctll::term<'\x7D'>) -> ctll::epsilon; - static constexpr auto rule(hexdec_repeat, - ctll::set<'0', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; + static constexpr auto rule(hexdec_repeat, ctll::term<'\x7D'>) + -> ctll::epsilon; + static constexpr auto + rule(hexdec_repeat, ctll::set<'0', 'A', 'B', 'C', 'D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; - static constexpr auto rule(i, ctll::term<'^'>) - -> ctll::push, - ctll::term<']'>>; - static constexpr auto rule(i, ctll::term<'x'>) - -> ctll::push, - ctll::term<'i'>, - ctll::term<'g'>, - ctll::term<'i'>, - ctll::term<'t'>, - class_named_xdigit, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'d'>) -> ctll::push, - ctll::term<'g'>, - ctll::term<'i'>, - ctll::term<'t'>, - class_named_digit, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'b'>) -> ctll::push, - ctll::term<'a'>, - ctll::term<'n'>, - ctll::term<'k'>, - class_named_blank, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'c'>) -> ctll::push, - ctll::term<'t'>, - ctll::term<'r'>, - ctll::term<'l'>, - class_named_cntrl, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'w'>) -> ctll::push, - ctll::term<'r'>, - ctll::term<'d'>, - class_named_word, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'l'>) -> ctll::push, - ctll::term<'w'>, - ctll::term<'e'>, - ctll::term<'r'>, - class_named_lower, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'s'>) -> ctll::push, - ctll::term<'a'>, - ctll::term<'c'>, - ctll::term<'e'>, - class_named_space, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'u'>) -> ctll::push, - ctll::term<'p'>, - ctll::term<'e'>, - ctll::term<'r'>, - class_named_upper, - ctll::term<':'>, - ctll::term<']'>>; - static constexpr auto rule(i, - ctll::term<'g'>) -> ctll::push, - ctll::term<'a'>, - ctll::term<'p'>, - ctll::term<'h'>, - class_named_graph, - ctll::term<':'>, - ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'^'>) -> ctll::push< + ctll::anything, + class_named_name, + negate_class_named, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'x'>) -> ctll::push< + ctll::anything, + ctll::term<'d'>, + ctll::term<'i'>, + ctll::term<'g'>, + ctll::term<'i'>, + ctll::term<'t'>, + class_named_xdigit, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'d'>) -> ctll::push< + ctll::anything, + ctll::term<'i'>, + ctll::term<'g'>, + ctll::term<'i'>, + ctll::term<'t'>, + class_named_digit, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'b'>) -> ctll::push< + ctll::anything, + ctll::term<'l'>, + ctll::term<'a'>, + ctll::term<'n'>, + ctll::term<'k'>, + class_named_blank, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'c'>) -> ctll::push< + ctll::anything, + ctll::term<'n'>, + ctll::term<'t'>, + ctll::term<'r'>, + ctll::term<'l'>, + class_named_cntrl, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'w'>) -> ctll::push< + ctll::anything, + ctll::term<'o'>, + ctll::term<'r'>, + ctll::term<'d'>, + class_named_word, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'l'>) -> ctll::push< + ctll::anything, + ctll::term<'o'>, + ctll::term<'w'>, + ctll::term<'e'>, + ctll::term<'r'>, + class_named_lower, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'s'>) -> ctll::push< + ctll::anything, + ctll::term<'p'>, + ctll::term<'a'>, + ctll::term<'c'>, + ctll::term<'e'>, + class_named_space, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'u'>) -> ctll::push< + ctll::anything, + ctll::term<'p'>, + ctll::term<'p'>, + ctll::term<'e'>, + ctll::term<'r'>, + class_named_upper, + ctll::term<':'>, + ctll::term<']'>>; + static constexpr auto rule(i, ctll::term<'g'>) -> ctll::push< + ctll::anything, + ctll::term<'r'>, + ctll::term<'a'>, + ctll::term<'p'>, + ctll::term<'h'>, + class_named_graph, + ctll::term<':'>, + ctll::term<']'>>; static constexpr auto rule(i, ctll::term<'a'>) -> ctll::push, ctll::term<']'>>; static constexpr auto rule(i, ctll::term<'p'>) @@ -2705,461 +2137,218 @@ namespace ctre { static constexpr auto rule(j, ctll::term<'\\'>) -> ctll::push; - static constexpr auto rule(j, - ctll::set<'!', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '.', - '/', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - '^', - '0', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; + static constexpr auto + rule(j, ctll::set<'!', '$', '\x28', '\x29', '*', '+', ',', '.', '/', ':', '<', '=', '>', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', '^', '0', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\x7B', '|', '\x7D', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; static constexpr auto rule(j, _others) -> ctll::push; static constexpr auto rule(j, ctll::set<'-', '[', ']'>) -> ctll::reject; - static constexpr auto rule(k, ctll::term<'\x7B'>) - -> ctll::push, - push_hexdec, - hexdec_repeat, - ctll::term<'\x7D'>, - finish_hexdec>; - static constexpr auto rule(k, - ctll::set<'0', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::push, - push_hexdec, - ctll::set<'0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f'>, - push_hexdec, - ctll::set<'0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f'>, - push_hexdec, - finish_hexdec>; + static constexpr auto rule(k, ctll::term<'\x7B'>) -> ctll::push< + create_hexdec, + ctll::anything, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + hexdec_repeat, + ctll::term<'\x7D'>, + finish_hexdec>; + static constexpr auto + rule(k, ctll::set<'0', 'A', 'B', 'C', 'D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + create_hexdec, + ctll::anything, + push_hexdec, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + finish_hexdec>; - static constexpr auto rule(l, ctll::term<'\x7B'>) - -> ctll::push, - push_hexdec, - hexdec_repeat, - ctll::term<'\x7D'>, - finish_hexdec>; - static constexpr auto rule(l, - ctll::set<'0', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::push, - push_hexdec, - finish_hexdec>; + static constexpr auto rule(l, ctll::term<'\x7B'>) -> ctll::push< + create_hexdec, + ctll::anything, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + hexdec_repeat, + ctll::term<'\x7D'>, + finish_hexdec>; + static constexpr auto + rule(l, ctll::set<'0', 'A', 'B', 'C', 'D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + create_hexdec, + ctll::anything, + push_hexdec, + ctll::set< + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f'>, + push_hexdec, + finish_hexdec>; - static constexpr auto rule( - m, - ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) - -> ctll::push, - make_back_reference>; + static constexpr auto + rule(m, ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + create_number, + number2, + ctll::term<'\x7D'>, + make_back_reference>; static constexpr auto rule(m, ctll::term<'-'>) - -> ctll::push, - make_relative_back_reference>; - static constexpr auto rule(m, - ctll::set<'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z'>) - -> ctll::push, - make_back_reference>; + -> ctll::push< + ctll::anything, + number, + ctll::term<'\x7D'>, + make_relative_back_reference>; + static constexpr auto rule(m, ctll::set<'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'>) + -> ctll::push< + ctll::anything, + push_name, + block_name2, + ctll::term<'\x7D'>, + make_back_reference>; - static constexpr auto rule(mod, - ctll::set<'!', - '$', - '\x28', - '\x29', - ',', - '-', - '.', - '/', - '0', - ':', - '<', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '[', - '\\', - '\"', - ']', - '^', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '|', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::epsilon; + static constexpr auto + rule(mod, ctll::set<'!', '$', '\x28', '\x29', ',', '-', '.', '/', '0', ':', '<', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', '\"', ']', '^', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '|', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::epsilon; static constexpr auto rule(mod, ctll::epsilon) -> ctll::epsilon; static constexpr auto rule(mod, _others) -> ctll::epsilon; static constexpr auto rule(mod, ctll::term<'?'>) -> ctll::push; static constexpr auto rule(mod, ctll::term<'+'>) -> ctll::push; - static constexpr auto rule(mod, - ctll::set<'*', '\x7B', '\x7D'>) -> ctll::reject; + static constexpr auto rule(mod, ctll::set<'*', '\x7B', '\x7D'>) + -> ctll::reject; static constexpr auto rule(mode_switch2, ctll::term<'i'>) -> ctll::push; @@ -3172,564 +2361,95 @@ namespace ctre { static constexpr auto rule(mode_switch2, ctll::term<'\x29'>) -> ctll::push; - static constexpr auto rule( - n, - ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) - -> ctll::push, - mod>; + static constexpr auto + rule(n, ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + create_number, + number2, + repeat_ab, + ctll::term<'\x7D'>, + mod>; static constexpr auto rule(n, ctll::term<'\x7D'>) -> ctll::push; - static constexpr auto rule(number2, - ctll::set<',', '\x7D'>) -> ctll::epsilon; - static constexpr auto rule( - number2, - ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) - -> ctll::push; + static constexpr auto rule(number2, ctll::set<',', '\x7D'>) + -> ctll::epsilon; + static constexpr auto + rule(number2, ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; - static constexpr auto rule( - number, - ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) - -> ctll::push; + static constexpr auto + rule(number, ctll::set<'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; - static constexpr auto rule(o, - ctll::set<'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z'>) - -> ctll::push'>, - content_in_capture, - make_capture_with_name, - ctll::term<'\x29'>>; + static constexpr auto rule(o, ctll::set<'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'>) + -> ctll::push< + ctll::anything, + push_name, + block_name2, + ctll::term<'>'>, + content_in_capture, + make_capture_with_name, + ctll::term<'\x29'>>; static constexpr auto rule(o, ctll::term<'!'>) - -> ctll::push>; + -> ctll::push< + ctll::anything, + reset_capture, + start_lookbehind_negative, + content_in_capture, + look_finish, + ctll::term<'\x29'>>; static constexpr auto rule(o, ctll::term<'='>) - -> ctll::push>; + -> ctll::push< + ctll::anything, + reset_capture, + start_lookbehind_positive, + content_in_capture, + look_finish, + ctll::term<'\x29'>>; - static constexpr auto rule(p, ctll::term<'p'>) - -> ctll::push, - ctll::term<'a'>, - class_named_alpha>; - static constexpr auto rule(p, ctll::term<'n'>) - -> ctll::push, - ctll::term<'m'>, - class_named_alnum>; + static constexpr auto rule(p, ctll::term<'p'>) -> ctll::push< + ctll::anything, + ctll::term<'h'>, + ctll::term<'a'>, + class_named_alpha>; + static constexpr auto rule(p, ctll::term<'n'>) -> ctll::push< + ctll::anything, + ctll::term<'u'>, + ctll::term<'m'>, + class_named_alnum>; - static constexpr auto rule(property_name2, - ctll::term<'\x7D'>) -> ctll::epsilon; + static constexpr auto rule(property_name2, ctll::term<'\x7D'>) + -> ctll::epsilon; static constexpr auto rule(property_name2, ctll::term<'='>) -> ctll::push; - static constexpr auto rule(property_name2, - ctll::set<'0', - '.', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) + static constexpr auto + rule(property_name2, ctll::set<'0', '.', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; + + static constexpr auto rule(property_name, ctll::set<'0', '.', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) -> ctll::push; - static constexpr auto rule(property_name, - ctll::set<'0', - '.', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; + static constexpr auto rule(property_value2, ctll::term<'\x7D'>) + -> ctll::epsilon; + static constexpr auto + rule(property_value2, ctll::set<'0', '.', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; - static constexpr auto rule(property_value2, - ctll::term<'\x7D'>) -> ctll::epsilon; - static constexpr auto rule(property_value2, - ctll::set<'0', - '.', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; + static constexpr auto + rule(property_value, ctll::set<'0', '.', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push; - static constexpr auto rule(property_value, - ctll::set<'0', - '.', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll::push; - - static constexpr auto rule(range, - ctll::set<'!', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '.', - '/', - '0', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '[', - '\\', - '\"', - ']', - '^', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::epsilon; + static constexpr auto rule(range, ctll::set<'!', '$', '\x28', '\x29', '*', '+', ',', '.', '/', '0', ':', '<', '=', '>', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', '\"', ']', '^', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\x7B', '|', '\x7D', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::epsilon; static constexpr auto rule(range, ctll::epsilon) -> ctll::epsilon; static constexpr auto rule(range, _others) -> ctll::epsilon; static constexpr auto rule(range, ctll::term<'-'>) -> ctll::push; - static constexpr auto rule(repeat, - ctll::set<'!', - '$', - '\x28', - '\x29', - ',', - '-', - '.', - '/', - '0', - ':', - '<', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '[', - '\\', - '\"', - ']', - '^', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '|', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::epsilon; + static constexpr auto rule(repeat, ctll::set<'!', '$', '\x28', '\x29', ',', '-', '.', '/', '0', ':', '<', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', '\"', ']', '^', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '|', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::epsilon; static constexpr auto rule(repeat, ctll::epsilon) -> ctll::epsilon; static constexpr auto rule(repeat, _others) -> ctll::epsilon; static constexpr auto rule(repeat, ctll::term<'?'>) @@ -3748,89 +2468,7 @@ namespace ctre { push, i, range, set_start, set2b>; static constexpr auto rule(set2a, ctll::term<'\\'>) -> ctll::push; - static constexpr auto rule(set2a, - ctll::set<'!', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '.', - '/', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - '^', - '0', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) + static constexpr auto rule(set2a, ctll::set<'!', '$', '\x28', '\x29', '*', '+', ',', '.', '/', ':', '<', '=', '>', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', '^', '0', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\x7B', '|', '\x7D', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) -> ctll::push; static constexpr auto rule(set2a, _others) -> ctll::push; @@ -3842,215 +2480,64 @@ namespace ctre { push, i, range, set_combine, set2b>; static constexpr auto rule(set2b, ctll::term<'\\'>) -> ctll::push; - static constexpr auto rule(set2b, - ctll::set<'!', - '$', - '\x28', - '\x29', - '*', - '+', - ',', - '.', - '/', - ':', - '<', - '=', - '>', - '?', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - '^', - '0', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '\x7B', - '|', - '\x7D', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) - -> ctll:: - push; - static constexpr auto rule(set2b, _others) + static constexpr auto rule(set2b, ctll::set<'!', '$', '\x28', '\x29', '*', '+', ',', '.', '/', ':', '<', '=', '>', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', '^', '0', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\x7B', '|', '\x7D', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) -> ctll:: push; + static constexpr auto rule( + set2b, + _others + ) -> ctll::push; static constexpr auto rule(set2b, ctll::term<'-'>) -> ctll::reject; - static constexpr auto rule(string2, - ctll::set<'\x29', '|'>) -> ctll::epsilon; + static constexpr auto rule(string2, ctll::set<'\x29', '|'>) + -> ctll::epsilon; static constexpr auto rule(string2, ctll::epsilon) -> ctll::epsilon; static constexpr auto rule(string2, ctll::term<'\\'>) -> ctll:: push; static constexpr auto rule(string2, ctll::term<'['>) -> ctll::push; - static constexpr auto rule(string2, ctll::term<'\x28'>) - -> ctll::push; - static constexpr auto rule(string2, - ctll::term<'^'>) -> ctll::push; - static constexpr auto rule(string2, - ctll::term<'$'>) -> ctll::push; - static constexpr auto rule(string2, - ctll::set<'!', - ',', - '/', - ':', - '<', - '0', - '-', - '=', - '>', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - '\"', - ']', - '_', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9'>) -> ctll::push) -> ctll::push< + ctll::anything, + prepare_capture, + block, + repeat, + string2, + make_sequence>; + static constexpr auto rule(string2, ctll::term<'^'>) -> ctll::push< + ctll::anything, + push_assert_begin, repeat, string2, make_sequence>; - static constexpr auto rule(string2, _others) -> ctll::push; + static constexpr auto rule(string2, ctll::term<'$'>) -> ctll::push< + ctll::anything, + push_assert_end, + repeat, + string2, + make_sequence>; + static constexpr auto + rule(string2, ctll::set<'!', ',', '/', ':', '<', '0', '-', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\"', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'>) + -> ctll::push< + ctll::anything, + push_character, + repeat, + string2, + make_sequence>; + static constexpr auto rule( + string2, + _others + ) -> ctll:: + push; static constexpr auto rule(string2, ctll::term<'.'>) - -> ctll::push; - static constexpr auto rule(string2, - ctll::set<'*', '+', '?', '\x7B', '\x7D'>) - -> ctll::reject; + -> ctll::push< + ctll::anything, + push_character_anything, + repeat, + string2, + make_sequence>; + static constexpr auto + rule(string2, ctll::set<'*', '+', '?', '\x7B', '\x7D'>) -> ctll::reject; }; } // namespace ctre @@ -4148,30 +2635,26 @@ namespace ctre { (this->set_flag(Args {}), ...); } - constexpr friend CTRE_FORCE_INLINE auto operator+( - flags f, - pcre::mode_case_insensitive) noexcept { + constexpr friend CTRE_FORCE_INLINE auto + operator+(flags f, pcre::mode_case_insensitive) noexcept { f.case_insensitive = true; return f; } - constexpr friend CTRE_FORCE_INLINE auto operator+( - flags f, - pcre::mode_case_sensitive) noexcept { + constexpr friend CTRE_FORCE_INLINE auto + operator+(flags f, pcre::mode_case_sensitive) noexcept { f.case_insensitive = false; return f; } - constexpr friend CTRE_FORCE_INLINE auto operator+( - flags f, - pcre::mode_singleline) noexcept { + constexpr friend CTRE_FORCE_INLINE auto + operator+(flags f, pcre::mode_singleline) noexcept { f.multiline = false; return f; } - constexpr friend CTRE_FORCE_INLINE auto operator+( - flags f, - pcre::mode_multiline) noexcept { + constexpr friend CTRE_FORCE_INLINE auto + operator+(flags f, pcre::mode_multiline) noexcept { f.multiline = true; return f; } @@ -4198,8 +2681,8 @@ namespace ctre { return f; } - constexpr CTRE_FORCE_INLINE auto consumed_something(flags f, - bool condition = true) { + constexpr CTRE_FORCE_INLINE auto + consumed_something(flags f, bool condition = true) { if (condition) f.block_empty_match = false; return f; } @@ -4228,9 +2711,8 @@ namespace ctre { template class MatchesCharacter { template - static auto test(CharT c) - -> decltype(Y::match_char(c, std::declval()), - std::true_type()); + static auto test(CharT c + ) -> decltype(Y::match_char(c, std::declval()), std::true_type()); template static auto test(...) -> std::false_type; @@ -4242,8 +2724,10 @@ namespace ctre { template constexpr CTRE_FORCE_INLINE bool is_ascii_alpha(T v) { - return ((v >= static_cast('a') && v <= static_cast('z')) || - (v >= static_cast('A') && v <= static_cast('Z'))); + return ( + (v >= static_cast('a') && v <= static_cast('z')) || + (v >= static_cast('A') && v <= static_cast('Z')) + ); } template @@ -4259,9 +2743,8 @@ namespace ctre { template struct character { template - CTRE_FORCE_INLINE static constexpr bool match_char( - CharT value, - const flags& f) noexcept { + CTRE_FORCE_INLINE static constexpr bool + match_char(CharT value, const flags& f) noexcept { if constexpr (is_ascii_alpha(V)) { if (is_case_insensitive(f)) { if (value == (V ^ static_cast(0x20))) { @@ -4276,9 +2759,8 @@ namespace ctre { template struct negative_set { template - CTRE_FORCE_INLINE static constexpr bool match_char( - CharT value, - const flags& f) noexcept { + CTRE_FORCE_INLINE static constexpr bool + match_char(CharT value, const flags& f) noexcept { return !(Content::match_char(value, f) || ... || false); } }; @@ -4286,9 +2768,8 @@ namespace ctre { template struct set { template - CTRE_FORCE_INLINE static constexpr bool match_char( - CharT value, - const flags& f) noexcept { + CTRE_FORCE_INLINE static constexpr bool + match_char(CharT value, const flags& f) noexcept { return (Content::match_char(value, f) || ... || false); } }; @@ -4299,9 +2780,8 @@ namespace ctre { template struct negate { template - CTRE_FORCE_INLINE static constexpr bool match_char( - CharT value, - const flags& f) noexcept { + CTRE_FORCE_INLINE static constexpr bool + match_char(CharT value, const flags& f) noexcept { return !(Content::match_char(value, f) || ... || false); } }; @@ -4309,9 +2789,8 @@ namespace ctre { template struct char_range { template - CTRE_FORCE_INLINE static constexpr bool match_char( - CharT value, - const flags& f) noexcept { + CTRE_FORCE_INLINE static constexpr bool + match_char(CharT value, const flags& f) noexcept { if constexpr (is_ascii_alpha_lowercase(A) && is_ascii_alpha_lowercase(B)) { if (is_case_insensitive(f)) { @@ -4332,44 +2811,45 @@ namespace ctre { return (value >= A) && (value <= B); } }; - using word_chars = set, - char_range<'a', 'z'>, - char_range<'0', '9'>, - character<'_'>>; + using word_chars = + set, + char_range<'a', 'z'>, + char_range<'0', '9'>, + character<'_'>>; using space_chars = enumeration<' ', '\t', '\n', '\v', '\f', '\r'>; - using vertical_space_chars = - enumeration; + using vertical_space_chars = enumeration< + char {0x000A}, // Linefeed (LF) + char {0x000B}, // Vertical tab (VT) + char {0x000C}, // Form feed (FF) + char {0x000D}, // Carriage return (CR) + char32_t {0x0085}, // Next line (NEL) + char32_t {0x2028}, // Line separator + char32_t {0x2029} // Paragraph separator + >; - using horizontal_space_chars = - enumeration; + using horizontal_space_chars = enumeration< + char {0x0009}, // Horizontal tab (HT) + char {0x0020}, // Space + char32_t {0x00A0}, // Non-break space + char32_t {0x1680}, // Ogham space mark + char32_t {0x180E}, // Mongolian vowel separator + char32_t {0x2000}, // En quad + char32_t {0x2001}, // Em quad + char32_t {0x2002}, // En space + char32_t {0x2003}, // Em space + char32_t {0x2004}, // Three-per-em space + char32_t {0x2005}, // Four-per-em space + char32_t {0x2006}, // Six-per-em space + char32_t {0x2007}, // Figure space + char32_t {0x2008}, // Punctuation space + char32_t {0x2009}, // Thin space + char32_t {0x200A}, // Hair space + char32_t {0x202F}, // Narrow no-break space + char32_t {0x205F}, // Medium mathematical space + char32_t {0x3000} // Ideographic space + >; using alphanum_chars = set, char_range<'a', 'z'>, char_range<'0', '9'>>; @@ -4379,38 +2859,39 @@ namespace ctre { using xdigit_chars = set, char_range<'a', 'f'>, char_range<'0', '9'>>; - using punct_chars = enumeration<'!', - '"', - '#', - '$', - '%', - '&', - '\'', - '(', - ')', - '*', - '+', - ',', - '-', - '.', - '/', - ':', - ';', - '<', - '=', - '>', - '?', - '@', - '[', - '\\', - ']', - '^', - '_', - '`', - '{', - '|', - '}', - '~'>; + using punct_chars = enumeration< + '!', + '"', + '#', + '$', + '%', + '&', + '\'', + '(', + ')', + '*', + '+', + ',', + '-', + '.', + '/', + ':', + ';', + '<', + '=', + '>', + '?', + '@', + '[', + '\\', + ']', + '^', + '_', + '`', + '{', + '|', + '}', + '~'>; using digit_chars = char_range<'0', '9'>; @@ -4557,8 +3038,8 @@ namespace uni { private: char32_t m_c; - script m_script; - int idx = 1; + script m_script; + int idx = 1; }; constexpr iterator begin() const; @@ -4569,29 +3050,29 @@ namespace uni { }; struct numeric_value { - constexpr double value() const; + constexpr double value() const; constexpr long long numerator() const; - constexpr int denominator() const; - constexpr bool is_valid() const; + constexpr int denominator() const; + constexpr bool is_valid() const; protected: constexpr numeric_value() = default; constexpr numeric_value(long long n, int16_t d); - long long _n = 0; - int16_t _d = 0; + long long _n = 0; + int16_t _d = 0; friend constexpr numeric_value cp_numeric_value(char32_t cp); }; - constexpr category cp_category(char32_t cp); - constexpr script cp_script(char32_t cp); + constexpr category cp_category(char32_t cp); + constexpr script cp_script(char32_t cp); constexpr script_extensions_view cp_script_extensions(char32_t cp); - constexpr version cp_age(char32_t cp); - constexpr block cp_block(char32_t cp); - constexpr bool cp_is_valid(char32_t cp); - constexpr bool cp_is_assigned(char32_t cp); - constexpr bool cp_is_ascii(char32_t cp); - constexpr numeric_value cp_numeric_value(char32_t cp); + constexpr version cp_age(char32_t cp); + constexpr block cp_block(char32_t cp); + constexpr bool cp_is_valid(char32_t cp); + constexpr bool cp_is_assigned(char32_t cp); + constexpr bool cp_is_ascii(char32_t cp); + constexpr numeric_value cp_numeric_value(char32_t cp); template