From a4c7f8bd98be2a200489325ff7c5061cf80ab4f3 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 27 Dec 2016 16:53:30 +0100 Subject: Imported Upstream version 8.6 --- interp/constrarg.ml | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'interp/constrarg.ml') diff --git a/interp/constrarg.ml b/interp/constrarg.ml index d9c60a18..ca828102 100644 --- a/interp/constrarg.ml +++ b/interp/constrarg.ml @@ -8,9 +8,14 @@ open Loc open Tacexpr -open Term open Misctypes open Genarg +open Geninterp + +let make0 ?dyn name = + let wit = Genarg.make0 name in + let () = Geninterp.register_val0 wit dyn in + wit (** This is a hack for now, to break the dependency of Genarg on constr-related types. We should use dedicated functions someday. *) @@ -19,56 +24,51 @@ let loc_of_or_by_notation f = function | AN c -> f c | ByNotation (loc,s,_) -> loc -let unsafe_of_type (t : argument_type) : ('a, 'b, 'c) Genarg.genarg_type = - Obj.magic t - -let wit_int_or_var = unsafe_of_type IntOrVarArgType +let wit_int_or_var = + make0 ~dyn:(val_tag (topwit Stdarg.wit_int)) "int_or_var" let wit_intro_pattern : (Constrexpr.constr_expr intro_pattern_expr located, glob_constr_and_expr intro_pattern_expr located, intro_pattern) genarg_type = - Genarg.make0 None "intropattern" - -let wit_tactic : (raw_tactic_expr, glob_tactic_expr, glob_tactic_expr) genarg_type = - Genarg.make0 None "tactic" + make0 "intropattern" -let wit_ident = unsafe_of_type IdentArgType +let wit_tactic : (raw_tactic_expr, glob_tactic_expr, Val.t) genarg_type = + make0 "tactic" -let wit_var = unsafe_of_type VarArgType +let wit_ltac = make0 ~dyn:(val_tag (topwit Stdarg.wit_unit)) "ltac" -let wit_ref = Genarg.make0 None "ref" +let wit_ident = + make0 "ident" -let wit_quant_hyp = unsafe_of_type QuantHypArgType +let wit_var = + make0 ~dyn:(val_tag (topwit wit_ident)) "var" -let wit_genarg = unsafe_of_type GenArgType +let wit_ref = make0 "ref" -let wit_sort : (glob_sort, glob_sort, sorts) genarg_type = - Genarg.make0 None "sort" +let wit_quant_hyp = make0 "quant_hyp" -let wit_constr = unsafe_of_type ConstrArgType +let wit_constr = + make0 "constr" -let wit_constr_may_eval = unsafe_of_type ConstrMayEvalArgType +let wit_uconstr = make0 "uconstr" -let wit_uconstr = Genarg.make0 None "uconstr" +let wit_open_constr = make0 ~dyn:(val_tag (topwit wit_constr)) "open_constr" -let wit_open_constr = unsafe_of_type OpenConstrArgType +let wit_constr_with_bindings = make0 "constr_with_bindings" -let wit_constr_with_bindings = unsafe_of_type ConstrWithBindingsArgType +let wit_bindings = make0 "bindings" -let wit_bindings = unsafe_of_type BindingsArgType - -let wit_hyp_location_flag : 'a Genarg.uniform_genarg_type = - Genarg.make0 None "hyp_location_flag" - -let wit_red_expr = unsafe_of_type RedExprArgType +let wit_red_expr = make0 "redexpr" let wit_clause_dft_concl = - Genarg.make0 None "clause_dft_concl" + make0 "clause_dft_concl" + +let wit_destruction_arg = + make0 "destruction_arg" -(** Register location *) +(** Aliases *) -let () = - register_name0 wit_ref "Constrarg.wit_ref"; - register_name0 wit_intro_pattern "Constrarg.wit_intro_pattern"; - register_name0 wit_tactic "Constrarg.wit_tactic"; - register_name0 wit_sort "Constrarg.wit_sort"; - register_name0 wit_uconstr "Constrarg.wit_uconstr"; - register_name0 wit_clause_dft_concl "Constrarg.wit_clause_dft_concl"; +let wit_reference = wit_ref +let wit_global = wit_ref +let wit_clause = wit_clause_dft_concl +let wit_quantified_hypothesis = wit_quant_hyp +let wit_intropattern = wit_intro_pattern +let wit_redexpr = wit_red_expr -- cgit v1.2.3