aboutsummaryrefslogtreecommitdiff
path: root/pretyping/patternops.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-06-21 22:50:08 +0200
committerEmilio Jesus Gallego Arias2019-07-08 15:59:10 +0200
commitc51fb2fae0e196012de47203b8a71c61720d6c5c (patch)
treee49c2d38b6c841dc6514944750d21ed08ab94bce /pretyping/patternops.ml
parent437063a0c745094c5693d1c5abba46ce375d69c6 (diff)
[api] Deprecate GlobRef constructors.
Not pretty, but it had to be done some day, as `Globnames` seems to be on the way out. I have taken the opportunity to reduce the number of `open` in the codebase. The qualified style would indeed allow us to use a bit nicer names `GlobRef.Inductive` instead of `IndRef`, etc... once we have the tooling to do large-scale refactoring that could be tried.
Diffstat (limited to 'pretyping/patternops.ml')
-rw-r--r--pretyping/patternops.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/pretyping/patternops.ml b/pretyping/patternops.ml
index 3600f1761b..99e3c5025e 100644
--- a/pretyping/patternops.ml
+++ b/pretyping/patternops.ml
@@ -132,7 +132,7 @@ let rec head_pattern_bound t =
| PIf (c,_,_) -> head_pattern_bound c
| PCase (_,p,c,br) -> head_pattern_bound c
| PRef r -> r
- | PVar id -> VarRef id
+ | PVar id -> GlobRef.VarRef id
| PEvar _ | PRel _ | PMeta _ | PSoApp _ | PSort _ | PFix _ | PProj _
-> raise BoundPattern
(* Perhaps they were arguments, but we don't beta-reduce *)
@@ -140,10 +140,10 @@ let rec head_pattern_bound t =
| PCoFix _ | PInt _ -> anomaly ~label:"head_pattern_bound" (Pp.str "not a type.")
let head_of_constr_reference sigma c = match EConstr.kind sigma c with
- | Const (sp,_) -> ConstRef sp
- | Construct (sp,_) -> ConstructRef sp
- | Ind (sp,_) -> IndRef sp
- | Var id -> VarRef id
+ | Const (sp,_) -> GlobRef.ConstRef sp
+ | Construct (sp,_) -> GlobRef.ConstructRef sp
+ | Ind (sp,_) -> GlobRef.IndRef sp
+ | Var id -> GlobRef.VarRef id
| _ -> anomaly (Pp.str "Not a rigid reference.")
let pattern_of_constr env sigma t =
@@ -175,9 +175,9 @@ let pattern_of_constr env sigma t =
with
| Some n -> PSoApp (n,Array.to_list (Array.map (pattern_of_constr env) a))
| None -> PApp (pattern_of_constr env f,Array.map (pattern_of_constr env) a))
- | Const (sp,u) -> PRef (ConstRef (Constant.make1 (Constant.canonical sp)))
- | Ind (sp,u) -> PRef (canonical_gr (IndRef sp))
- | Construct (sp,u) -> PRef (canonical_gr (ConstructRef sp))
+ | Const (sp,u) -> PRef (GlobRef.ConstRef (Constant.make1 (Constant.canonical sp)))
+ | Ind (sp,u) -> PRef (canonical_gr (GlobRef.IndRef sp))
+ | Construct (sp,u) -> PRef (canonical_gr (GlobRef.ConstructRef sp))
| Proj (p, c) ->
pattern_of_constr env (EConstr.Unsafe.to_constr (Retyping.expand_projection env sigma p (EConstr.of_constr c) []))
| Evar (evk,ctxt as ev) ->