File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ module Category = MessageCategory
8
8
9
9
open GobResult.Syntax
10
10
11
+ module Format = BatFormat
12
+
11
13
12
14
module Severity =
13
15
struct
@@ -195,10 +197,14 @@ let print ?(ppf= !formatter) (m: Message.t) =
195
197
| Debug -> "white" (* non-bright white is actually some gray *)
196
198
| Success -> "green"
197
199
in
198
- let pp_prefix = Format .dprintf "@{<%s>[%a]%a@}" severity_stag Severity .pp m .severity Tags .pp m .tags in
200
+ let pp_print_option ?(none = fun _ () -> () ) pp_v ppf = function
201
+ | None -> none ppf ()
202
+ | Some v -> pp_v ppf v
203
+ in
204
+ let pp_prefix = (fun ppf -> Format .fprintf ppf "@{<%s>[%a]%a@}" severity_stag Severity .pp m .severity Tags .pp m .tags) in
199
205
let pp_loc ppf = Format .fprintf ppf " @{<violet>(%a)@}" CilType.Location .pp in
200
206
let pp_loc ppf loc =
201
- Format .fprintf ppf "%a" (Format . pp_print_option pp_loc ) (Option .map Location .to_cil loc )
207
+ Format .fprintf ppf "%a" (pp_print_option pp_loc ) (Option .map Location .to_cil loc )
202
208
in
203
209
let pp_piece ppf piece =
204
210
Format .fprintf ppf "@{<%s>%s@}%a" severity_stag (Piece .text_with_context piece ) pp_loc piece .loc
@@ -229,7 +235,7 @@ let print ?(ppf= !formatter) (m: Message.t) =
229
235
let pp_quote ppf loc =
230
236
if get_bool "warn.quote-code" then (
231
237
let pp_cut_quote ppf = Format .fprintf ppf "@,@[<v 0>%a@,@]" pp_quote in
232
- (Format . pp_print_option pp_cut_quote ) ppf (Option .map Location .to_cil loc )
238
+ (pp_print_option pp_cut_quote ) ppf (Option .map Location .to_cil loc )
233
239
)
234
240
in
235
241
let pp_piece ppf piece = Format .fprintf ppf "%a%a" pp_piece piece pp_quote piece .loc in
You can’t perform that action at this time.
0 commit comments