separate pretty-printer for pp_kind

Reviewed By: jvillard

Differential Revision: D3762892

fbshipit-source-id: 49dcf48
master
Sam Blackshear 9 years ago committed by Facebook Github Bot 2
parent 5d3a15fd9c
commit a31a735e35

@ -82,10 +82,13 @@ module JavaSource = struct
let equal t1 t2 =
compare t1 t2 = 0
let pp fmt s = match s.kind with
| SharedPreferences -> F.fprintf fmt "SharedPreferences(%a)" CallSite.pp s.site
| Footprint ap -> F.fprintf fmt "Footprint(%a)" AccessPath.pp ap
| Other -> F.fprintf fmt "Other(%a)" CallSite.pp s.site
let pp_kind fmt (kind : kind) = match kind with
| SharedPreferences -> F.fprintf fmt "SharedPreferences"
| SourceKind.Footprint ap -> F.fprintf fmt "Footprint[%a]" AccessPath.pp ap
| SourceKind.Other -> F.fprintf fmt "Other"
let pp fmt s =
F.fprintf fmt "%a(%a)" pp_kind s.kind CallSite.pp s.site
module Set = PrettyPrintable.MakePPSet(struct
type nonrec t = t
@ -154,9 +157,12 @@ module JavaSink = struct
let equal t1 t2 =
compare t1 t2 = 0
let pp fmt s = match s.kind with
| Logging -> F.fprintf fmt "Logging(%a)" CallSite.pp s.site
| Other -> F.fprintf fmt "%a" CallSite.pp s.site
let pp_kind fmt (kind : kind) = match kind with
| Logging -> F.fprintf fmt "Logging"
| Other -> F.fprintf fmt "Other"
let pp fmt s =
F.fprintf fmt "%a(%a)" pp_kind s.kind CallSite.pp s.site
module Set = PrettyPrintable.MakePPSet(struct
type nonrec t = t

@ -20,6 +20,7 @@ module type S = sig
val compare : t -> t -> int
val equal : t -> t -> bool
val pp_kind : F.formatter -> kind -> unit
val pp : F.formatter -> t -> unit
module Set : PrettyPrintable.PPSet with type elt = t

@ -21,6 +21,7 @@ module MockTrace = Trace.Make(struct
let compare = CallSite.compare
let equal = CallSite.equal
let pp = CallSite.pp
let pp_kind _ _ = assert false
let to_callee t _ = t

@ -35,10 +35,12 @@ module MockTraceElem = struct
let equal t1 t2 =
compare t1 t2 = 0
let pp fmt = function
let pp_kind fmt = function
| Kind1 -> F.fprintf fmt "Kind1"
| Kind2 -> F.fprintf fmt "Kind2"
let pp = pp_kind
module Set = PrettyPrintable.MakePPSet(struct
type nonrec t = t
let compare = compare

Loading…
Cancel
Save