1234567891011121314151617181920212223242526272829303132333435363738394041424344(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)(* <O___,, * (see CREDITS file for the list of authors) *)(* \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) *)(************************************************************************)(************************************************************************)(* Coq Language Server Protocol *)(* Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *)(* Copyright 2019-2022 Inria -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias *)(************************************************************************)letcoq_interp~intern:_~stcmd=letst=State.to_coqstinletcmd=Ast.to_coqcmdinVernacinterp.interp~stcmd|>State.of_coqletinterp~token~intern~stcmd=Protect.eval~tokencmd~f:(coq_interp~intern~st)moduleRequire=struct(* We could improve this Coq upstream by making the API a bit more
orthogonal *)letinterp~intern:_~st_files{Ast.Require.from;export;mods;loc=_;attrs;control}=let()=Vernacstate.unfreeze_interp_state(State.to_coqst)inletfn()=Vernacentries.vernac_requirefromexportmodsin(* Check generic attributes *)letfn()=Attributes.unsupported_attributesattrs;fn()in(* Execute control commands *)let()=Utils.with_control~fn~control~stinVernacstate.freeze_interp_state~marshallable:false|>State.of_coqletinterp~token~intern~stfilescmd=Protect.eval~token~f:(interp~intern~stfiles)cmdend