@@ -647,17 +647,50 @@ ForeverStack<N>::resolve_final_segment (Node &final_node, std::string &seg_name,
647
647
return final_node.rib .get (seg_name);
648
648
}
649
649
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
+
650
669
template <Namespace N>
651
670
template <typename S>
652
671
tl::optional<Rib::Definition>
653
672
ForeverStack<N>::resolve_path (
654
673
const std::vector<S> &segments, ResolutionMode mode,
655
674
std::function<void (const S &, NodeId)> insert_segment_resolution,
656
675
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)
657
691
{
658
692
rust_assert (!segments.empty ());
659
693
660
- std::reference_wrapper<Node> starting_point = cursor ();
661
694
switch (mode)
662
695
{
663
696
case ResolutionMode::Normal:
0 commit comments