123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331# 13 "plugins/ssrmatching/g_ssrmatching.mlg"openLtac_pluginopenPcoq.ConstropenSsrmatchingopenSsrmatching.Internal(* Defining grammar rules with "xx" in it automatically declares keywords too,
* we thus save the lexer to restore it at the end of the file *)letfrozen_lexer=ref(Pcoq.get_keyword_state());;let()=Mltop.add_init_function"coq-core.plugins.ssreflect"(fun()->frozen_lexer:=Pcoq.get_keyword_state())let_=Mltop.add_known_module"coq-core.plugins.ssrmatching"# 30 "plugins/ssrmatching/g_ssrmatching.mlg"letpr_rpattern___=pr_rpatternlet(wit_rpattern,rpattern)=Tacentries.argument_extend~plugin:"coq-core.plugins.ssrmatching"~name:"rpattern"{Tacentries.arg_parsing=Vernacextend.Arg_rules([(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"as"))))((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))(func_x_eloc-># 51 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(E_As_X_In_T(mk_ltermeNone,mk_ltermxNone,mk_ltermcNone))));(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))(func_x_eloc-># 49 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(E_In_X_In_T(mk_ltermeNone,mk_ltermxNone,mk_ltermcNone))));(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))(func_x_loc-># 47 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(In_X_In_T(mk_ltermxNone,mk_ltermcNone))));(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermlconstr)))((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))(func_xloc-># 45 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(X_In_T(mk_ltermxNone,mk_ltermcNone))));(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.token(Pcoq.terminal"in"))))((Pcoq.Symbol.ntermlconstr)))(func_loc-># 43 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(In_T(mk_ltermcNone))));(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermlconstr)))(funcloc-># 42 "plugins/ssrmatching/g_ssrmatching.mlg"mk_rpattern(T(mk_ltermcNone))))]);Tacentries.arg_tag=Some(Geninterp.val_tag(Genarg.topwitwit_rpatternty));Tacentries.arg_intern=Tacentries.ArgInternFun((funfistv->(ist,fistv))(# 40 "plugins/ssrmatching/g_ssrmatching.mlg"glob_rpattern));Tacentries.arg_subst=Tacentries.ArgSubstFun(# 41 "plugins/ssrmatching/g_ssrmatching.mlg"subst_rpattern);Tacentries.arg_interp=Tacentries.ArgInterpSimple(# 39 "plugins/ssrmatching/g_ssrmatching.mlg"interp_rpattern);Tacentries.arg_printer=((funenvsigma-># 38 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern),(funenvsigma-># 38 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern),(funenvsigma-># 38 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern));}let_=(wit_rpattern,rpattern)# 54 "plugins/ssrmatching/g_ssrmatching.mlg"letpr_ssrterm___=pr_ssrtermlet(wit_cpattern,cpattern)=Tacentries.argument_extend~plugin:"coq-core.plugins.ssrmatching"~name:"cpattern"{Tacentries.arg_parsing=Vernacextend.Arg_rules([(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.token(Pcoq.terminal"Qed"))))((Pcoq.Symbol.ntermconstr)))(func_loc-># 66 "plugins/ssrmatching/g_ssrmatching.mlg"mk_ltermcNone))]);Tacentries.arg_tag=None;Tacentries.arg_intern=Tacentries.ArgInternFun((funfistv->(ist,fistv))(# 63 "plugins/ssrmatching/g_ssrmatching.mlg"glob_cpattern));Tacentries.arg_subst=Tacentries.ArgSubstFun(# 63 "plugins/ssrmatching/g_ssrmatching.mlg"subst_ssrterm);Tacentries.arg_interp=Tacentries.ArgInterpSimple(# 62 "plugins/ssrmatching/g_ssrmatching.mlg"interp_ssrterm);Tacentries.arg_printer=((funenvsigma-># 64 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm),(funenvsigma-># 65 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm),(funenvsigma-># 61 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm));}let_=(wit_cpattern,cpattern)# 69 "plugins/ssrmatching/g_ssrmatching.mlg"letinput_ssrtermkindkwstatestrm=matchGramlib.LStream.peek_nthkwstate0strmwith|Tok.KEYWORD"("->InParens|Tok.KEYWORD"@"->WithAt|_->NoFlagletssrtermkind=Pcoq.Entry.(of_parser"ssrtermkind"{parser_fun=input_ssrtermkind})let_=let()=Egramml.grammar_extend~plugin_uid:("coq-core.plugins.ssrmatching","g_ssrmatching.mlg:0")cpattern(Pcoq.Reuse(None,[Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermssrtermkind)))((Pcoq.Symbol.ntermconstr)))(funckloc-># 81 "plugins/ssrmatching/g_ssrmatching.mlg"letpattern=mk_termkcNoneinifloc_of_cpatternpattern<>Someloc&&k=InParensthenmk_termCpatterncNoneelsepattern)]))in()let(wit_lcpattern,lcpattern)=Tacentries.argument_extend~plugin:"coq-core.plugins.ssrmatching"~name:"lcpattern"{Tacentries.arg_parsing=Vernacextend.Arg_rules([(Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.token(Pcoq.terminal"Qed"))))((Pcoq.Symbol.ntermlconstr)))(func_loc-># 95 "plugins/ssrmatching/g_ssrmatching.mlg"mk_ltermcNone))]);Tacentries.arg_tag=Some(Geninterp.val_tag(Genarg.topwitwit_cpattern));Tacentries.arg_intern=Tacentries.ArgInternFun((funfistv->(ist,fistv))(# 92 "plugins/ssrmatching/g_ssrmatching.mlg"glob_cpattern));Tacentries.arg_subst=Tacentries.ArgSubstFun(# 92 "plugins/ssrmatching/g_ssrmatching.mlg"subst_ssrterm);Tacentries.arg_interp=Tacentries.ArgInterpSimple(# 91 "plugins/ssrmatching/g_ssrmatching.mlg"interp_ssrterm);Tacentries.arg_printer=((funenvsigma-># 93 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm),(funenvsigma-># 94 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm),(funenvsigma-># 90 "plugins/ssrmatching/g_ssrmatching.mlg"pr_ssrterm));}let_=(wit_lcpattern,lcpattern)let_=let()=Egramml.grammar_extend~plugin_uid:("coq-core.plugins.ssrmatching","g_ssrmatching.mlg:1")lcpattern(Pcoq.Reuse(None,[Pcoq.Production.make(Pcoq.Rule.next(Pcoq.Rule.next(Pcoq.Rule.stop)((Pcoq.Symbol.ntermssrtermkind)))((Pcoq.Symbol.ntermlconstr)))(funckloc-># 100 "plugins/ssrmatching/g_ssrmatching.mlg"letpattern=mk_termkcNoneinifloc_of_cpatternpattern<>Someloc&&k=InParensthenmk_termCpatterncNoneelsepattern)]))in()let(wit_ssrpatternarg,ssrpatternarg)=Tacentries.argument_extend~plugin:"coq-core.plugins.ssrmatching"~name:"ssrpatternarg"{Tacentries.arg_parsing=Vernacextend.Arg_alias(rpattern);Tacentries.arg_tag=Some(Geninterp.val_tag(Genarg.topwitwit_rpattern));Tacentries.arg_intern=Tacentries.ArgInternWit(wit_rpattern);Tacentries.arg_subst=Tacentries.ArgSubstWit(wit_rpattern);Tacentries.arg_interp=Tacentries.ArgInterpWit(wit_rpattern);Tacentries.arg_printer=((funenvsigma-># 107 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern),(funenvsigma-># 107 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern),(funenvsigma-># 107 "plugins/ssrmatching/g_ssrmatching.mlg"pr_rpattern));}let_=(wit_ssrpatternarg,ssrpatternarg)let()=Tacentries.tactic_extend"coq-core.plugins.ssrmatching""ssrinstoftpat"~level:0[(Tacentries.TyML(Tacentries.TyIdent("ssrinstancesoftpat",Tacentries.TyArg(Extend.TUentry(Genarg.get_arg_tagwit_cpattern),Tacentries.TyNil)),(funargist-># 112 "plugins/ssrmatching/g_ssrmatching.mlg"ssrinstancesofarg)))]# 115 "plugins/ssrmatching/g_ssrmatching.mlg"(* We wipe out all the keywords generated by the grammar rules we defined. *)(* The user is supposed to Require Import ssreflect or Require ssreflect *)(* and Import ssreflect.SsrSyntax to obtain these keywords and as a *)(* consequence the extended ssreflect grammar. *)let()=Mltop.add_init_function"coq-core.plugins.ssreflect"(fun()->Pcoq.set_keyword_state!frozen_lexer);;