Skip to content

Commit 3b9514c

Browse files
committed
Add doc comment for Component.Fmt helper functions
1 parent c4aa545 commit 3b9514c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/xref2/component.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,16 @@ module Fmt = struct
598598
| [] -> ()
599599
| t -> fpf ppf fmt_outer (Format.pp_print_list ~pp_sep pp_a) t
600600

601+
(* Three helper functions to help with paths. Generally paths
602+
have constructors of the form [`Hidden(p1)] or
603+
[`Alias(p1,p2)]. When printing these paths, if we're printing a
604+
short path we often want to just ignore the constructor and print
605+
one of the inner paths, [p1] or [p2]. These functions do that. If
606+
[short_paths] is set in the config, we skip to one of the inner
607+
paths - in [wrap] there's no choice, but in [wrap2] we pick [p1]
608+
and in [wrap2r] we pick [p2]. If [short_paths] is not set, we
609+
print a string representing the constructor, and one or both paths
610+
with brackets. *)
601611
let wrap :
602612
type a.
603613
config ->

0 commit comments

Comments
 (0)