From 3099be05553dab10b41d864f4981860eb105f145 Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Wed, 4 Apr 2018 16:06:50 +0200 Subject: Notation: remove support for prim tokens denoting inductive types in "return" This is prim token notations for inductive *types*, not values. So we're speaking of a scope where 0 is the type nat, 1 is the type bool, etc. To my knowledge, this feature hasn't ever been used, and is very unlikely to be used ever, so let's clean the code a bit by removing it. --- interp/constrextern.ml | 13 +------------ interp/notation.ml | 14 -------------- interp/notation.mli | 2 -- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 009894fddb..ddc0a5c000 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -531,18 +531,7 @@ let extern_ind_pattern_in_scope (custom,scopes as allscopes) vars ind args = else try if !Flags.raw_print || !print_no_symbol then raise No_match; - let (sc,p) = uninterp_prim_token_ind_pattern ind args in - match availability_of_entry_coercion custom InConstrEntrySomeLevel with - | None -> raise No_match - | Some coercion -> - match availability_of_prim_token p sc scopes with - | None -> raise No_match - | Some key -> - insert_pat_coercion coercion (insert_pat_delimiters (CAst.make @@ CPatPrim p) key) - with No_match -> - try - if !Flags.raw_print || !print_no_symbol then raise No_match; - extern_notation_ind_pattern allscopes vars ind args + extern_notation_ind_pattern allscopes vars ind args (uninterp_ind_pattern_notations ind) with No_match -> let c = extern_reference vars (IndRef ind) in diff --git a/interp/notation.ml b/interp/notation.ml index 4b25146c50..ebb734cb08 100644 --- a/interp/notation.ml +++ b/interp/notation.ml @@ -654,20 +654,6 @@ let uninterp_prim_token c = | Some n -> (sc,n) with Not_found -> raise Notation_ops.No_match -let uninterp_prim_token_ind_pattern ind args = - let ref = IndRef ind in - try - let k = RefKey (canonical_gr ref) in - let (sc,numpr,b) = KeyMap.find k !prim_token_key_table in - if not b then raise Notation_ops.No_match; - let args' = List.map - (fun x -> snd (glob_constr_of_closed_cases_pattern x)) args in - let ref = DAst.make @@ GRef (ref,None) in - match numpr (AnyGlobConstr (DAst.make @@ GApp (ref,args'))) with - | None -> raise Notation_ops.No_match - | Some n -> (sc,n) - with Not_found -> raise Notation_ops.No_match - let uninterp_prim_token_cases_pattern c = try let k = cases_pattern_key c in diff --git a/interp/notation.mli b/interp/notation.mli index c921606484..e8408330af 100644 --- a/interp/notation.mli +++ b/interp/notation.mli @@ -110,8 +110,6 @@ val uninterp_prim_token : 'a glob_constr_g -> scope_name * prim_token val uninterp_prim_token_cases_pattern : 'a cases_pattern_g -> Name.t * scope_name * prim_token -val uninterp_prim_token_ind_pattern : - inductive -> cases_pattern list -> scope_name * prim_token val availability_of_prim_token : prim_token -> scope_name -> subscopes -> delimiters option option -- cgit v1.2.3