123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)(************************************************************************)(* SerAPI: Coq interaction protocol with bidirectional serialization *)(************************************************************************)(* Copyright 2016-2019 MINES ParisTech -- License LGPL 2.1+ *)(* Copyright 2019-2023 Inria -- License LGPL 2.1+ *)(* Written by: Emilio J. Gallego Arias and others *)(************************************************************************)openSexplib.Stdtypepp_tag=[%import:Pp.pp_tag][@@derivingsexp,yojson]typeblock_type=[%import:Pp.block_type][@@derivingsexp,yojson]moduleP=structtype_t=|Pp_empty|Pp_stringofstring|Pp_glueof_tlist|Pp_boxofblock_type*_t|Pp_tagofpp_tag*_t(* Are those redundant? *)|Pp_print_breakofint*int|Pp_force_newline|Pp_commentofstringlist[@@derivingsexp,yojson]openPpletrecfrom_t(d:t):_t=matchreprdwith|Ppcmd_empty->Pp_empty|Ppcmd_strings->Pp_strings|Ppcmd_gluel->Pp_glue(List.mapfrom_t l)|Ppcmd_box(bt,d)->Pp_box(bt,from_td)|Ppcmd_tag (t,d)->Pp_tag(t,from_t d)|Ppcmd_print_break(n,m)->Pp_print_break(n,m)|Ppcmd_force_newline ->Pp_force_newline|Ppcmd_comments->Pp_commentsletrecto_t(d:_t):t=unrepr(matchdwith|Pp_empty->Ppcmd_empty|Pp_strings->Ppcmd_strings|Pp_gluel->Ppcmd_glue(List.mapto_tl)|Pp_box(bt,d)->Ppcmd_box(bt,to_td)|Pp_tag(t,d)->Ppcmd_tag(t,to_td)|Pp_print_break(n,m)->Ppcmd_print_break(n,m)|Pp_force_newline->Ppcmd_force_newline|Pp_comments->Ppcmd_comments)endtypet=Pp.tlett_of_sexps=P.(to_t(_t_of_sexps))letsexp_of_td=P.(sexp_of__t(from_td))letof_yojsonjson=Ppx_deriving_yojson_runtime.(P.(_t_of_yojsonjson>|=to_t))letto_yojsonlevel=P.(_t_to_yojson(from_tlevel))typedoc_view=[%import:Pp.doc_view][@@derivingsexp,yojson]