123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384(************************************************************************)(* * 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) *)(************************************************************************)openPcoq[@@@ocaml.warning"-3"]letuvernac=create_universe"vernac"[@@deprecated"Deprecated in 8.13"][@@@ocaml.warning"+3"]typeproof_mode=string(* Tactic parsing modes *)letregister_proof_mode,find_proof_mode,lookup_proof_mode=letproof_mode:(string,Vernacexpr.vernac_exprEntry.t)Hashtbl.t=Hashtbl.create19inletregister_proof_modeenamee=Hashtbl.addproof_modeenamee;enameinletfind_proof_modeename=tryHashtbl.findproof_modeenamewithNot_found->CErrors.anomalyPp.(str"proof mode not found: "++strename)inletlookup_proof_modename=ifHashtbl.memproof_modenamethenSomenameelseNoneinregister_proof_mode,find_proof_mode,lookup_proof_modeletproof_mode_to_stringname=nameletcommand_entry_ref=refNonemoduleVernac_=struct(* The different kinds of vernacular commands *)letgallina=Entry.create"gallina"letgallina_ext=Entry.create"gallina_ext"letcommand=Entry.create"command"letsyntax=Entry.create"syntax_command"letvernac_control=Entry.create"Vernac.vernac_control"letinductive_definition=Entry.create"Vernac.inductive_definition"letfix_definition=Entry.create"Vernac.fix_definition"letrec_definition=fix_definitionletred_expr=Entry.create"red_expr"lethint_info=Entry.create"hint_info"(* Main vernac entry *)letmain_entry=Entry.create"vernac"letnoedit_mode=Entry.create"noedit_command"let()=letact_vernacvloc=Somevinletact_eoi_loc=Noneinletrule=[Pcoq.(Production.make(Rule.nextRule.stop(Symbol.tokenTok.PEOI))act_eoi);Pcoq.(Production.make(Rule.nextRule.stop(Symbol.ntermvernac_control))act_vernac);]inPcoq.(grammar_extendmain_entry(Fresh(Gramlib.Gramext.First,[None,None,rule])))letselect_tactic_entryspec=matchspecwith|None->noedit_mode|Someename->find_proof_modeenameletcommand_entry=Pcoq.Entry.(of_parser"command_entry"{parser_fun=(funstrm->Pcoq.Entry.parse_token_stream(select_tactic_entry!command_entry_ref)strm)})endmoduleUnsafe=structletset_tactic_entryoname=command_entry_ref:=onameendletmain_entryproof_mode=Unsafe.set_tactic_entryproof_mode;Vernac_.main_entrylet()=register_grammarGenredexpr.wit_red_expr(Vernac_.red_expr);