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 *)(************************************************************************)letcmake=CAst.makemoduleLoc=Ser_locmoduleCAst=Ser_cAstmoduleNames=Ser_namestype_t=|Ser_QualidofNames.DirPath.t*Names.Id.t[@@derivingsexp,yojson,hash,compare]let_t_putqid=let(dp,id)=Libnames.repr_qualid(cmakeqid)inSer_Qualid(dp,id)let_t_get(Ser_Qualid(dp,id))=Libnames.(make_qualiddpid).CAst.vtypequalid_r=[%import:Libnames.qualid_r]letqualid_r_of_sexpsexp=_t_get(_t_of_sexpsexp)letsexp_of_qualid_rqid=sexp_of__t(_t_putqid)letqualid_r_of_yojsonjson=Ppx_deriving_yojson_runtime.(_t_of_yojsonjson>|=_t_get)letqualid_r_to_yojsonlevel=_t_to_yojson(_t_putlevel)(* let hash_qualid_r x = hash__t (_t_put x) *)lethash_fold_qualid_rstx=hash_fold__tst(_t_putx)letcompare_qualid_rxy=compare__t(_t_putx)(_t_puty)(* qualid: private *)typequalid=[%import:Libnames.qualid][@@derivingsexp,yojson,hash,compare]moduleFP=structtype_t={dirpath:Names.DirPath.t;basename:Names.Id.t}[@@derivingsexp,yojson,hash,compare]let_t_get{dirpath;basename}=Libnames.make_pathdirpathbasenamelet_t_putfp=letdirpath,basename=Libnames.repr_path fpin{dirpath;basename }endopenFPtypefull_path=Libnames.full_pathletfull_path_of_sexpsexp=_t_get(_t_of_sexpsexp)letsexp_of_full_pathqid=sexp_of__t(_t_putqid)letfull_path_of_yojsonjson=Ppx_deriving_yojson_runtime.(_t_of_yojsonjson>|=_t_get)letfull_path_to_yojsonlevel=_t_to_yojson(_t_putlevel)lethash_full_pathx=hash__t(_t_putx)lethash_fold_full_pathstx=hash_fold__tst(_t_putx)letcompare_full_pathxy=compare__t(_t_putx)(_t_puty)