• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbarbin / pplumbing / 30

12 May 2025 08:09AM UTC coverage: 95.775% (+0.005%) from 95.77%
30

push

github

mbarbin
Add unused annotations in migrate expr

- This has no impact on the rewrite itself but I find it more readable that way.

816 of 852 relevant lines covered (95.77%)

8.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/pp_tty/src/pp_tty.ml
1
(*********************************************************************************)
2
(*  pplumbing - Utility libraries to use with [pp]                               *)
3
(*  SPDX-FileCopyrightText: 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com>  *)
4
(*  SPDX-License-Identifier: MIT                                                 *)
5
(*********************************************************************************)
6

7
module Ansi_color = Ansi_color
8
module Style = Stdune.User_message.Style
9
module Print_config = Stdune.User_message.Print_config
10

11
type t = Style.t Pp.t
12

13
let print ?(config = Print_config.default) t = Ansi_color.print (Pp.map_tags t ~f:config)
×
14
let prerr ?(config = Print_config.default) t = Ansi_color.prerr (Pp.map_tags t ~f:config)
×
15
let tag = Pp.tag
16
let surround s1 s2 t = Pp.box ~indent:1 Pp.O.(Pp.verbatim s1 ++ t ++ Pp.verbatim s2)
×
17
let parens t = surround "(" ")" t
×
18
let brackets t = surround "[" "]" t
×
19
let braces t = surround "{" "}" t
×
20
let simple_quotes t = surround "'" "'" t
×
21
let double_quotes t = surround "\"" "\"" t
×
22

23
let stdune_loc (loc : Loc.t) =
24
  let { Loc.Lexbuf_loc.start; stop } = Loc.to_lexbuf_loc loc in
×
25
  Stdune.Loc.of_lexbuf_loc { start; stop }
×
26
;;
27

28
let loc loc =
29
  Stdune.Loc.pp (stdune_loc loc)
×
30
  |> Pp.map_tags ~f:(fun (Loc : Stdune.Loc.tag) -> Style.Loc)
×
31
;;
32

33
module type To_string = sig
34
  type t
35

36
  val to_string : t -> string
37
end
38

39
let id (type a) (module M : To_string with type t = a) x =
40
  Pp.tag Style.Id (Pp.verbatim (M.to_string x)) |> brackets
×
41
;;
42

43
let kwd (type a) (module M : To_string with type t = a) x =
44
  Pp.tag Style.Kwd (Pp.verbatim (M.to_string x)) |> brackets
×
45
;;
46

47
let ansi (type a) (module M : To_string with type t = a) x styles =
48
  Pp.tag (Style.Ansi_styles styles) (Pp.verbatim (M.to_string x))
×
49
;;
50

51
let path (type a) (module M : To_string with type t = a) x =
52
  Pp.tag (Style.Ansi_styles [ `Bold ]) (Pp.verbatim (M.to_string x)) |> double_quotes
×
53
;;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc