1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374(************************************************************************)(* v * The Coq Proof Assistant / The Coq Development Team *)(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(************************************************************************)(************************************************************************)(* Coq serialization API/Plugin *)(* Copyright 2016 MINES ParisTech *)(************************************************************************)(* Status: Very Experimental *)(************************************************************************)(* open Sexplib.Std *)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_pathfpin{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)