diff options
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/topconstr.ml | 7 | ||||
| -rw-r--r-- | interp/topconstr.mli | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/interp/topconstr.ml b/interp/topconstr.ml index 666f9022bd..32595cdc65 100644 --- a/interp/topconstr.ml +++ b/interp/topconstr.ml @@ -890,6 +890,12 @@ let rec prod_constr_expr c = function List.fold_right (fun x b -> mkProdC([x],bk,t,b)) idl (prod_constr_expr c bl) +let coerce_reference_to_id = function + | Ident (_,id) -> id + | Qualid (loc,_) -> + user_err_loc (loc, "coerce_reference_to_id", + str "This expression should be a simple identifier.") + let coerce_to_id = function | CRef (Ident (loc,id)) -> (loc,id) | a -> user_err_loc @@ -903,6 +909,7 @@ let coerce_to_name = function (constr_loc a,"coerce_to_name", str "This expression should be a name.") + (* Used in correctness and interface *) let map_binder g e nal = List.fold_right (fun (_,na) -> name_fold g na) nal e diff --git a/interp/topconstr.mli b/interp/topconstr.mli index 1982a08fd3..0b6cf46c59 100644 --- a/interp/topconstr.mli +++ b/interp/topconstr.mli @@ -200,6 +200,7 @@ val mkLambdaC : name located list * binder_kind * constr_expr * constr_expr -> c val mkLetInC : name located * constr_expr * constr_expr -> constr_expr val mkProdC : name located list * binder_kind * constr_expr * constr_expr -> constr_expr +val coerce_reference_to_id : reference -> identifier val coerce_to_id : constr_expr -> identifier located val coerce_to_name : constr_expr -> name located |
