MCPcopy Create free account
hub / github.com/boostorg/parser / extend_subsequence_impl

Function extend_subsequence_impl

include/boost/parser/detail/text/trie_map.hpp:886–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884
885 template<typename KeyIter, typename Sentinel>
886 match_result extend_subsequence_impl(
887 match_result prev, KeyIter & first, Sentinel last) const
888 {
889 if (to_node_ptr(prev.node) == &header_) {
890 if (header_.empty())
891 return prev;
892 prev.node = header_.child(0);
893 }
894
895 if (first == last) {
896 prev.match = !!to_node_ptr(prev.node)->value();
897 prev.leaf = to_node_ptr(prev.node)->empty();
898 return prev;
899 }
900
901 node_t const * node = to_node_ptr(prev.node);
902 size_type size = prev.size;
903 while (first != last) {
904 auto const it = node->find(*first, comp_);
905 if (it == node->end())
906 break;
907 ++first;
908 ++size;
909 node = it->get();
910 }
911
912 return match_result{node, size, !!node->value(), node->empty()};
913 }
914
915 static match_result back_up_to_match(match_result retval)
916 {

Callers 2

trie_map.hppFile · 0.70
longest_match_implFunction · 0.70

Calls 7

to_node_ptrFunction · 0.70
emptyMethod · 0.45
childMethod · 0.45
valueMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected