[sledge] Avoid ocamlformat regression

Summary:
The formatting of sugared list syntax regressed with
https://github.com/ocaml-ppx/ocamlformat/pull/1567.

Reviewed By: ngorogiannis

Differential Revision: D28907812

fbshipit-source-id: 16ad68218
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 48ca11ef64
commit 94c68c8b2a

@ -37,10 +37,13 @@ let build_info =
List.fold_left libs 0 ~f:(fun n (name, _) ->
max n (String.length name) )
in
String.concat ~sep:"\n"
( Printf.sprintf "%-*s %s" (max_length + 2) "ocaml:" Sys.ocaml_version
:: "statically linked libraries:"
:: List.map libs ~f:(fun (name, v) ->
Printf.sprintf "- %-*s %s" max_length name v )
@ [Printf.sprintf "%-*s %b" (max_length + 2) "debug:" debug; "version:"]
)
let pp_lib ppf (name, v) =
Format.fprintf ppf "- %-*s %s" max_length name v
in
let pf x = Format.fprintf Format.str_formatter x in
pf "%-*s %s@\n" (max_length + 2) "ocaml:" Sys.ocaml_version ;
pf "statically linked libraries:@\n" ;
pf "%a@\n" (List.pp "@\n" pp_lib) libs ;
pf "%-*s %b@\n" (max_length + 2) "debug:" debug ;
pf "version:" ;
Format.flush_str_formatter ()

@ -837,13 +837,11 @@ let rec simplify_ us rev_xss survived ancestor_subst q =
let survived =
Var.Set.union survived (fv (elim_exists stem.xs stem))
in
let q =
starN
( stem
:: List.map q.djns ~f:(fun djn ->
let djns =
List.map q.djns ~f:(fun djn ->
orN (List.map ~f:(simplify_ us rev_xss survived subst) djn) )
)
in
let q = starN (stem :: djns) in
if is_false q then false_ q.us
else
let removed = Var.Set.diff removed survived in

Loading…
Cancel
Save