diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2005-06-22 08:01:24 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2005-06-22 08:01:24 +0000 |
commit | 21a4125e10d7b8033457962fc42e7dc9b77ec1f2 (patch) | |
tree | 16f7a54181dff3ee3d2ee975950e3862b8e214a5 /parsing | |
parent | 5722ca635828b09e55d02133db5932212136cf16 (diff) |
Added entry constr_may_eval for tactic extensions (new syntax)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@7162 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/g_ltacnew.ml4 | 18 | ||||
-rw-r--r-- | parsing/pcoq.ml4 | 3 | ||||
-rw-r--r-- | parsing/pcoq.mli | 3 |
3 files changed, 16 insertions, 8 deletions
diff --git a/parsing/g_ltacnew.ml4 b/parsing/g_ltacnew.ml4 index 9e0a10931..734a65174 100644 --- a/parsing/g_ltacnew.ml4 +++ b/parsing/g_ltacnew.ml4 @@ -41,7 +41,7 @@ let arg_of_expr = function if not !Options.v7 then GEXTEND Gram - GLOBAL: tactic Vernac_.command tactic_expr tactic_arg; + GLOBAL: tactic Vernac_.command tactic_expr tactic_arg constr_may_eval; tactic_expr: [ "5" LEFTA @@ -110,14 +110,20 @@ GEXTEND Gram | c = Constr.constr -> ConstrMayEval (ConstrTerm c) ] ] ; may_eval_arg: + [ [ c = constr_eval -> ConstrMayEval c + | IDENT "fresh"; s = OPT STRING -> TacFreshId s ] ] + ; + constr_eval: [ [ IDENT "eval"; rtc = red_expr; "in"; c = Constr.constr -> - ConstrMayEval (ConstrEval (rtc,c)) + ConstrEval (rtc,c) | IDENT "context"; id = identref; "["; c = Constr.lconstr; "]" -> - ConstrMayEval (ConstrContext (id,c)) + ConstrContext (id,c) | IDENT "type"; IDENT "of"; c = Constr.constr -> - ConstrMayEval (ConstrTypeOf c) - | IDENT "fresh"; s = OPT STRING -> - TacFreshId s ] ] + ConstrTypeOf c ] ] + ; + constr_may_eval: (* For extensions *) + [ [ c = constr_eval -> c + | c = Constr.constr -> ConstrTerm c ] ] ; tactic_atom: [ [ id = METAIDENT -> MetaIdArg (loc,id) diff --git a/parsing/pcoq.ml4 b/parsing/pcoq.ml4 index 135a9f8d1..292e981be 100644 --- a/parsing/pcoq.ml4 +++ b/parsing/pcoq.ml4 @@ -380,7 +380,8 @@ module Tactic = make_gen_entry utactic rawwit_constr_with_bindings "constr_with_bindings" let bindings = make_gen_entry utactic rawwit_bindings "bindings" - let constrarg = make_gen_entry utactic rawwit_constr_may_eval "constrarg" +(*v7*) let constrarg = make_gen_entry utactic rawwit_constr_may_eval "constrarg" +(*v8*) let constr_may_eval = make_gen_entry utactic rawwit_constr_may_eval "constr_may_eval" let quantified_hypothesis = make_gen_entry utactic rawwit_quant_hyp "quantified_hypothesis" let int_or_var = make_gen_entry utactic rawwit_int_or_var "int_or_var" diff --git a/parsing/pcoq.mli b/parsing/pcoq.mli index c073a3d9f..a6aa7417e 100644 --- a/parsing/pcoq.mli +++ b/parsing/pcoq.mli @@ -164,7 +164,8 @@ module Tactic : val casted_open_constr : open_constr_expr Gram.Entry.e val constr_with_bindings : constr_expr with_bindings Gram.Entry.e val bindings : constr_expr bindings Gram.Entry.e - val constrarg : (constr_expr,reference) may_eval Gram.Entry.e +(*v7*) val constrarg : (constr_expr,reference) may_eval Gram.Entry.e +(*v8*) val constr_may_eval : (constr_expr,reference) may_eval Gram.Entry.e val quantified_hypothesis : quantified_hypothesis Gram.Entry.e val int_or_var : int or_var Gram.Entry.e val red_expr : raw_red_expr Gram.Entry.e |