|
406 | 406 | let rec sum_to_json =
|
407 | 407 | (fun x ->
|
408 | 408 | match x with
|
409 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 409 | + | A -> |
| 410 | + (Obj.magic |
| 411 | + [| |
| 412 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 413 | + |] |
| 414 | + : Js.Json.t) |
410 | 415 | | B x_0 ->
|
411 |
| - (Obj.magic [| string_to_json "B"; int_to_json x_0 |] |
| 416 | + (Obj.magic |
| 417 | + [| |
| 418 | + Ppx_deriving_json_runtime.Primitives.string_to_json "B"; |
| 419 | + int_to_json x_0; |
| 420 | + |] |
412 | 421 | : Js.Json.t)
|
413 | 422 | | C { name = x_name } ->
|
414 | 423 | (Obj.magic
|
415 | 424 | [|
|
416 |
| - string_to_json "C"; |
| 425 | + Ppx_deriving_json_runtime.Primitives.string_to_json "C"; |
417 | 426 | (Obj.magic [%mel.obj { name = string_to_json x_name }]
|
418 | 427 | : Js.Json.t);
|
419 | 428 | |]
|
|
472 | 481 | | S2 (x_0, x_1) ->
|
473 | 482 | (Obj.magic
|
474 | 483 | [|
|
475 |
| - string_to_json "S2"; int_to_json x_0; string_to_json x_1; |
| 484 | + Ppx_deriving_json_runtime.Primitives.string_to_json "S2"; |
| 485 | + int_to_json x_0; |
| 486 | + string_to_json x_1; |
476 | 487 | |]
|
477 | 488 | : Js.Json.t)
|
478 | 489 | : sum2 -> Js.Json.t)
|
|
532 | 543 | let rec other_to_json =
|
533 | 544 | (fun x ->
|
534 | 545 | match x with
|
535 |
| - | `C -> (Obj.magic [| string_to_json "C" |] : Js.Json.t) |
| 546 | + | `C -> |
| 547 | + (Obj.magic |
| 548 | + [| |
| 549 | + Ppx_deriving_json_runtime.Primitives.string_to_json "C"; |
| 550 | + |] |
| 551 | + : Js.Json.t) |
536 | 552 | : other -> Js.Json.t)
|
537 | 553 |
|
538 | 554 | let _ = other_to_json
|
|
595 | 611 | let rec poly_to_json =
|
596 | 612 | (fun x ->
|
597 | 613 | match x with
|
598 |
| - | `A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 614 | + | `A -> |
| 615 | + (Obj.magic |
| 616 | + [| |
| 617 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 618 | + |] |
| 619 | + : Js.Json.t) |
599 | 620 | | `B x_0 ->
|
600 |
| - (Obj.magic [| string_to_json "B"; int_to_json x_0 |] |
| 621 | + (Obj.magic |
| 622 | + [| |
| 623 | + Ppx_deriving_json_runtime.Primitives.string_to_json "B"; |
| 624 | + int_to_json x_0; |
| 625 | + |] |
601 | 626 | : Js.Json.t)
|
602 | 627 | | #other as x -> other_to_json x
|
603 | 628 | : poly -> Js.Json.t)
|
|
663 | 688 | | `P2 (x_0, x_1) ->
|
664 | 689 | (Obj.magic
|
665 | 690 | [|
|
666 |
| - string_to_json "P2"; int_to_json x_0; string_to_json x_1; |
| 691 | + Ppx_deriving_json_runtime.Primitives.string_to_json "P2"; |
| 692 | + int_to_json x_0; |
| 693 | + string_to_json x_1; |
667 | 694 | |]
|
668 | 695 | : Js.Json.t)
|
669 | 696 | : poly2 -> Js.Json.t)
|
|
721 | 748 | fun x ->
|
722 | 749 | match x with
|
723 | 750 | | `C x_0 ->
|
724 |
| - (Obj.magic [| string_to_json "C"; a_to_json x_0 |] : Js.Json.t) |
| 751 | + (Obj.magic |
| 752 | + [| |
| 753 | + Ppx_deriving_json_runtime.Primitives.string_to_json "C"; |
| 754 | + a_to_json x_0; |
| 755 | + |] |
| 756 | + : Js.Json.t) |
725 | 757 |
|
726 | 758 | let _ = c_to_json
|
727 | 759 | end [@@ocaml.doc "@inline"] [@@merlin.hide]
|
|
775 | 807 | let rec recur_to_json =
|
776 | 808 | (fun x ->
|
777 | 809 | match x with
|
778 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 810 | + | A -> |
| 811 | + (Obj.magic |
| 812 | + [| |
| 813 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 814 | + |] |
| 815 | + : Js.Json.t) |
779 | 816 | | Fix x_0 ->
|
780 |
| - (Obj.magic [| string_to_json "Fix"; recur_to_json x_0 |] |
| 817 | + (Obj.magic |
| 818 | + [| |
| 819 | + Ppx_deriving_json_runtime.Primitives.string_to_json "Fix"; |
| 820 | + recur_to_json x_0; |
| 821 | + |] |
781 | 822 | : Js.Json.t)
|
782 | 823 | : recur -> Js.Json.t)
|
783 | 824 |
|
|
842 | 883 | let rec polyrecur_to_json =
|
843 | 884 | (fun x ->
|
844 | 885 | match x with
|
845 |
| - | `A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 886 | + | `A -> |
| 887 | + (Obj.magic |
| 888 | + [| |
| 889 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 890 | + |] |
| 891 | + : Js.Json.t) |
846 | 892 | | `Fix x_0 ->
|
847 |
| - (Obj.magic [| string_to_json "Fix"; polyrecur_to_json x_0 |] |
| 893 | + (Obj.magic |
| 894 | + [| |
| 895 | + Ppx_deriving_json_runtime.Primitives.string_to_json "Fix"; |
| 896 | + polyrecur_to_json x_0; |
| 897 | + |] |
848 | 898 | : Js.Json.t)
|
849 | 899 | : polyrecur -> Js.Json.t)
|
850 | 900 |
|
|
900 | 950 | let rec evar_to_json =
|
901 | 951 | (fun x ->
|
902 | 952 | match x with
|
903 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
904 |
| - | B -> (Obj.magic [| string_to_json "b_aliased" |] : Js.Json.t) |
| 953 | + | A -> |
| 954 | + (Obj.magic |
| 955 | + [| |
| 956 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 957 | + |] |
| 958 | + : Js.Json.t) |
| 959 | + | B -> |
| 960 | + (Obj.magic |
| 961 | + [| |
| 962 | + Ppx_deriving_json_runtime.Primitives.string_to_json |
| 963 | + "b_aliased"; |
| 964 | + |] |
| 965 | + : Js.Json.t) |
905 | 966 | : evar -> Js.Json.t)
|
906 | 967 |
|
907 | 968 | let _ = evar_to_json
|
|
964 | 1025 | let rec epoly_to_json =
|
965 | 1026 | (fun x ->
|
966 | 1027 | match x with
|
967 |
| - | `a -> (Obj.magic [| string_to_json "A_aliased" |] : Js.Json.t) |
968 |
| - | `b -> (Obj.magic [| string_to_json "b" |] : Js.Json.t) |
| 1028 | + | `a -> |
| 1029 | + (Obj.magic |
| 1030 | + [| |
| 1031 | + Ppx_deriving_json_runtime.Primitives.string_to_json |
| 1032 | + "A_aliased"; |
| 1033 | + |] |
| 1034 | + : Js.Json.t) |
| 1035 | + | `b -> |
| 1036 | + (Obj.magic |
| 1037 | + [| |
| 1038 | + Ppx_deriving_json_runtime.Primitives.string_to_json "b"; |
| 1039 | + |] |
| 1040 | + : Js.Json.t) |
969 | 1041 | : epoly -> Js.Json.t)
|
970 | 1042 |
|
971 | 1043 | let _ = epoly_to_json
|
|
1019 | 1091 | fun x ->
|
1020 | 1092 | match x with
|
1021 | 1093 | | A x_0 ->
|
1022 |
| - (Obj.magic [| string_to_json "A"; a_to_json x_0 |] : Js.Json.t) |
| 1094 | + (Obj.magic |
| 1095 | + [| |
| 1096 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
| 1097 | + a_to_json x_0; |
| 1098 | + |] |
| 1099 | + : Js.Json.t) |
1023 | 1100 | | B x_0 ->
|
1024 |
| - (Obj.magic [| string_to_json "B"; b_to_json x_0 |] : Js.Json.t) |
| 1101 | + (Obj.magic |
| 1102 | + [| |
| 1103 | + Ppx_deriving_json_runtime.Primitives.string_to_json "B"; |
| 1104 | + b_to_json x_0; |
| 1105 | + |] |
| 1106 | + : Js.Json.t) |
1025 | 1107 |
|
1026 | 1108 | let _ = p2_to_json
|
1027 | 1109 | end [@@ocaml.doc "@inline"] [@@merlin.hide]
|
|
1147 | 1229 | | A { a = x_a } ->
|
1148 | 1230 | (Obj.magic
|
1149 | 1231 | [|
|
1150 |
| - string_to_json "A"; |
| 1232 | + Ppx_deriving_json_runtime.Primitives.string_to_json "A"; |
1151 | 1233 | (Obj.magic [%mel.obj { a = int_to_json x_a }] : Js.Json.t);
|
1152 | 1234 | |]
|
1153 | 1235 | : Js.Json.t)
|
|
0 commit comments