aboutsummaryrefslogtreecommitdiff
path: root/interp/dumpglob.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-07-03 09:54:31 +0200
committerGaëtan Gilbert2019-07-03 09:54:31 +0200
commit73999ad6ba6c33783f27ffc705930cbc5c745728 (patch)
treed2d12c00ef94e941bb3392ef119329f9d44d010b /interp/dumpglob.ml
parent0cc7e942cd04f7fd28336045e43345b47a48b7a5 (diff)
parent62567575f4639aad44de93a88d9cc425a11d4a9e (diff)
Merge PR #10419: [api] Refactor most of `Decl_kinds`
Reviewed-by: SkySkimmer Ack-by: herbelin
Diffstat (limited to 'interp/dumpglob.ml')
-rw-r--r--interp/dumpglob.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/interp/dumpglob.ml b/interp/dumpglob.ml
index e1269025a4..482303d935 100644
--- a/interp/dumpglob.ml
+++ b/interp/dumpglob.ml
@@ -69,7 +69,7 @@ let previous_state = ref MultFiles
let pause () = previous_state := !glob_output; glob_output := NoGlob
let continue () = glob_output := !previous_state
-open Decl_kinds
+open Decls
open Declarations
let type_of_logical_kind = function
@@ -104,13 +104,20 @@ let type_of_logical_kind = function
| Corollary -> "thm")
| IsPrimitive -> "prim"
+
+(** Data associated to global parameters and constants *)
+
+let csttab = Summary.ref (Names.Cmap.empty : logical_kind Names.Cmap.t) ~name:"CONSTANT"
+let add_constant_kind kn k = csttab := Names.Cmap.add kn k !csttab
+let constant_kind kn = Names.Cmap.find kn !csttab
+
let type_of_global_ref gr =
if Typeclasses.is_class gr then
"class"
else
match gr with
| Globnames.ConstRef cst ->
- type_of_logical_kind (Decls.constant_kind cst)
+ type_of_logical_kind (constant_kind cst)
| Globnames.VarRef v ->
"var" ^ type_of_logical_kind (Decls.variable_kind v)
| Globnames.IndRef ind ->