@@ -647,17 +647,50 @@ ForeverStack<N>::resolve_final_segment (Node &final_node, std::string &seg_name,
647647 return final_node.rib .get (seg_name);
648648}
649649
650+ template <Namespace N>
651+ template <typename S>
652+ tl::optional<Rib::Definition>
653+ ForeverStack<N>::resolve_path (
654+ const std::vector<S> &segments, ResolutionMode mode,
655+ std::function<void (const S &, NodeId)> insert_segment_resolution,
656+ std::vector<Error> &collect_errors, NodeId starting_point_id)
657+ {
658+ auto starting_point = dfs_node (root, starting_point_id);
659+
660+ // We may have a prelude, but haven't visited it yet and thus it's not in our
661+ // nodes
662+ if (!starting_point)
663+ return tl::nullopt ;
664+
665+ return resolve_path (segments, mode, insert_segment_resolution,
666+ collect_errors, *starting_point);
667+ }
668+
650669template <Namespace N>
651670template <typename S>
652671tl::optional<Rib::Definition>
653672ForeverStack<N>::resolve_path (
654673 const std::vector<S> &segments, ResolutionMode mode,
655674 std::function<void (const S &, NodeId)> insert_segment_resolution,
656675 std::vector<Error> &collect_errors)
676+ {
677+ std::reference_wrapper<Node> starting_point = cursor ();
678+
679+ return resolve_path (segments, mode, insert_segment_resolution,
680+ collect_errors, starting_point);
681+ }
682+
683+ template <Namespace N>
684+ template <typename S>
685+ tl::optional<Rib::Definition>
686+ ForeverStack<N>::resolve_path (
687+ const std::vector<S> &segments, ResolutionMode mode,
688+ std::function<void (const S &, NodeId)> insert_segment_resolution,
689+ std::vector<Error> &collect_errors,
690+ std::reference_wrapper<Node> starting_point)
657691{
658692 rust_assert (!segments.empty ());
659693
660- std::reference_wrapper<Node> starting_point = cursor ();
661694 switch (mode)
662695 {
663696 case ResolutionMode::Normal:
0 commit comments