Skip to content

Commit

Permalink
Add doc comment for Component.Fmt helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Mar 7, 2024
1 parent e3d4e36 commit 63ef560
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/xref2/component.ml
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,16 @@ module Fmt = struct
| [] -> ()
| t -> fpf ppf fmt_outer (Format.pp_print_list ~pp_sep pp_a) t

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

0 comments on commit 63ef560

Please sign in to comment.