From f6f6990bf1d2759a84916713e5db36bcd91e47b4 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 16 Jul 2024 11:16:44 -0400 Subject: [PATCH] fix format --- .ocamlformat | 3 ++- src/compilerlib/pb_codegen_encode_yojson.ml | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.ocamlformat b/.ocamlformat index c611b8d9..79ad47bc 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version = 0.24.1 +version = 0.26.2 profile=conventional margin=80 if-then-else=k-r @@ -12,3 +12,4 @@ field-space=tight-decl leading-nested-match-parens=true module-item-spacing=compact quiet=true +ocaml-version=4.08 diff --git a/src/compilerlib/pb_codegen_encode_yojson.ml b/src/compilerlib/pb_codegen_encode_yojson.ml index 2badc3be..3471050a 100644 --- a/src/compilerlib/pb_codegen_encode_yojson.ml +++ b/src/compilerlib/pb_codegen_encode_yojson.ml @@ -136,13 +136,17 @@ let gen_rft_variant sc rf_label { Ot.v_constructors; _ } = F.sub_scope sc (fun sc -> match vc_field_type with | Ot.Vct_nullary -> - F.linep sc "| %s -> (\"%s\", `Null) :: assoc" vc_constructor json_label + F.linep sc "| %s -> (\"%s\", `Null) :: assoc" vc_constructor + json_label | Ot.Vct_non_nullary_constructor field_type -> (match gen_field var_name json_label field_type vc_payload_kind with - | None -> F.linep sc "| %s -> (\"%s\", `Null) :: assoc" vc_constructor json_label - | Some exp -> F.linep sc "| %s v -> %s :: assoc" vc_constructor exp))) + | None -> + F.linep sc "| %s -> (\"%s\", `Null) :: assoc" vc_constructor + json_label + | Some exp -> + F.linep sc "| %s v -> %s :: assoc" vc_constructor exp))) v_constructors); F.linep sc "in (* match v.%s *)" rf_label