[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, _) -> List.fold_left libs 0 ~f:(fun n (name, _) ->
max n (String.length name) ) max n (String.length name) )
in in
String.concat ~sep:"\n" let pp_lib ppf (name, v) =
( Printf.sprintf "%-*s %s" (max_length + 2) "ocaml:" Sys.ocaml_version Format.fprintf ppf "- %-*s %s" max_length name v
:: "statically linked libraries:" in
:: List.map libs ~f:(fun (name, v) -> let pf x = Format.fprintf Format.str_formatter x in
Printf.sprintf "- %-*s %s" max_length name v ) pf "%-*s %s@\n" (max_length + 2) "ocaml:" Sys.ocaml_version ;
@ [Printf.sprintf "%-*s %b" (max_length + 2) "debug:" debug; "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 = let survived =
Var.Set.union survived (fv (elim_exists stem.xs stem)) Var.Set.union survived (fv (elim_exists stem.xs stem))
in in
let q = let djns =
starN List.map q.djns ~f:(fun djn ->
( stem
:: List.map q.djns ~f:(fun djn ->
orN (List.map ~f:(simplify_ us rev_xss survived subst) djn) ) orN (List.map ~f:(simplify_ us rev_xss survived subst) djn) )
)
in in
let q = starN (stem :: djns) in
if is_false q then false_ q.us if is_false q then false_ q.us
else else
let removed = Var.Set.diff removed survived in let removed = Var.Set.diff removed survived in

Loading…
Cancel
Save