aboutsummaryrefslogtreecommitdiff
path: root/interp/modintern.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-06-10 23:11:06 +0200
committerEmilio Jesus Gallego Arias2019-09-18 16:16:00 +0200
commit42ff3109217452853c3b853d21f09a317dd6e37d (patch)
treed95cc4e262956c48fe15b02ce59c6507420b305b /interp/modintern.ml
parentc5ecc185ccb804e02ef78012fc6ae38c092cc80a (diff)
[library] Move `Declaremods` to `vernac/`
We move `Declaremods` to the vernac layer as it implement vernac-specific logic to manipulate modules which moreover is highly imperative. This forces code [such as printing] to manipulate the _global imperative_ state which is a bit fishy. The key improvement in this PR is that now `Global` is not used anymore in `library`, so we can proceed to move it upwards. This move is a follow-up of #10562 and a step towards moving `Global` upper, likely to `interp` in the short term.
Diffstat (limited to 'interp/modintern.ml')
-rw-r--r--interp/modintern.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/interp/modintern.ml b/interp/modintern.ml
index 955288244e..ddf5b2d7b1 100644
--- a/interp/modintern.ml
+++ b/interp/modintern.ml
@@ -12,7 +12,6 @@ open Declarations
open Libnames
open Constrexpr
open Constrintern
-open Declaremods
type module_internalization_error =
| NotAModuleNorModtype of string
@@ -21,9 +20,11 @@ type module_internalization_error =
exception ModuleInternalizationError of module_internalization_error
+type module_kind = Module | ModType | ModAny
+
let error_not_a_module_loc kind loc qid =
let s = string_of_qualid qid in
- let e = let open Declaremods in match kind with
+ let e = match kind with
| Module -> Modops.ModuleTypingError (Modops.NotAModule s)
| ModType -> Modops.ModuleTypingError (Modops.NotAModuleType s)
| ModAny -> ModuleInternalizationError (NotAModuleNorModtype s)
@@ -46,7 +47,6 @@ let error_application_to_module_type loc =
it is equal to the input kind when this one isn't ModAny. *)
let lookup_module_or_modtype kind qid =
- let open Declaremods in
let loc = qid.CAst.loc in
try
if kind == ModType then raise Not_found;