Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jul 16, 2024
1 parent 20e71e0 commit f6f6990
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 0.24.1
version = 0.26.2
profile=conventional
margin=80
if-then-else=k-r
Expand All @@ -12,3 +12,4 @@ field-space=tight-decl
leading-nested-match-parens=true
module-item-spacing=compact
quiet=true
ocaml-version=4.08
10 changes: 7 additions & 3 deletions src/compilerlib/pb_codegen_encode_yojson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6f6990

Please sign in to comment.