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 f9e48e4
Showing 1 changed file with 7 additions and 3 deletions.
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 f9e48e4

Please sign in to comment.