Skip to content

Commit

Permalink
Remove empty lines from large matches
Browse files Browse the repository at this point in the history
  • Loading branch information
clarus committed Jan 25, 2022
1 parent f7492fb commit bb8427d
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/exp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1560,18 +1560,6 @@ let rec to_coq (paren : bool) (e : t) : SmartPrint.t =
match single_let with
| Some single_let -> single_let
| None ->
let has_existential_cases =
cases
|> List.exists (function
| _, Some { new_typ_vars = _ :: _; _ }, _
| _, Some { use_axioms = true; _ }, _ ->
true
| _ -> false)
in
let is_large_match =
has_existential_cases && List.length cases >= 5
in
let separator = if is_large_match then newline else space in
let dep_match_print =
match dep_match with
| None -> empty
Expand All @@ -1584,7 +1572,7 @@ let rec to_coq (paren : bool) (e : t) : SmartPrint.t =
nest
(!^"match" ^^ to_coq false e ^^ dep_match_print ^^ !^"with"
^^ newline
^^ separate separator
^^ separate space
(cases
|> List.map (fun (p, existential_cast, e) ->
nest
Expand Down

0 comments on commit bb8427d

Please sign in to comment.