aboutsummaryrefslogtreecommitdiff
path: root/library/lib.ml
diff options
context:
space:
mode:
authorEnrico Tassi2018-07-26 18:15:12 +0200
committerEnrico Tassi2018-07-26 18:15:12 +0200
commit06c78339555a47cebc0f2c0ce4daa6c97488024d (patch)
tree27ae59b7b85001deb44c8b18867df5012878b6ca /library/lib.ml
parent85d5f45d7a5374646a31f8829965bbfed0a95070 (diff)
parent32caa7b700cb2f561edec9b86fbb4583d2962d4d (diff)
Merge PR #8101: Remove ClosedModule and ClosedSection from libstack
Diffstat (limited to 'library/lib.ml')
-rw-r--r--library/lib.ml17
1 files changed, 3 insertions, 14 deletions
diff --git a/library/lib.ml b/library/lib.ml
index 8b83261e48..8ebe44890c 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -26,13 +26,11 @@ type node =
| Leaf of obj
| CompilingLibrary of object_prefix
| OpenedModule of is_type * export * object_prefix * Summary.frozen
- | ClosedModule of library_segment
| OpenedSection of object_prefix * Summary.frozen
- | ClosedSection of library_segment
-and library_entry = object_name * node
+type library_entry = object_name * node
-and library_segment = library_entry list
+type library_segment = library_entry list
type lib_objects = (Names.Id.t * obj) list
@@ -73,10 +71,6 @@ let classify_segment seg =
clean ((id,o')::substl, keepl, anticipl) stk
| Anticipate o' ->
clean (substl, keepl, o'::anticipl) stk)
- | (_,ClosedSection _) :: stk -> clean acc stk
- (* LEM; TODO: Understand what this does and see if what I do is the
- correct thing for ClosedMod(ule|type) *)
- | (_,ClosedModule _) :: stk -> clean acc stk
| (_,OpenedSection _) :: _ -> user_err Pp.(str "there are still opened sections")
| (_,OpenedModule (ty,_,_,_)) :: _ ->
user_err ~hdr:"Lib.classify_segment"
@@ -307,7 +301,6 @@ let end_mod is_type =
in
let (after,mark,before) = split_lib_at_opening oname in
lib_state := { !lib_state with lib_stk = before };
- add_entry oname (ClosedModule (List.rev (mark::after)));
let prefix = !lib_state.path_prefix in
recalc_path_prefix ();
(oname, prefix, fs, after)
@@ -555,7 +548,6 @@ let discharge_item ((sp,_ as oname),e) =
match e with
| Leaf lobj ->
Option.map (fun o -> (basename sp,o)) (discharge_object (oname,lobj))
- | ClosedSection _ | ClosedModule _ -> None
| OpenedSection _ | OpenedModule _ | CompilingLibrary _ ->
anomaly (Pp.str "discharge_item.")
@@ -570,7 +562,6 @@ let close_section () =
let (secdecls,mark,before) = split_lib_at_opening oname in
lib_state := { !lib_state with lib_stk = before };
pop_path_prefix ();
- add_entry oname (ClosedSection (List.rev (mark::secdecls)));
let newdecls = List.map discharge_item secdecls in
Summary.unfreeze_summaries fs;
List.iter (Option.iter (fun (id,o) -> add_discharged_leaf id o)) newdecls
@@ -589,10 +580,8 @@ let freeze ~marshallable =
| n, (CompilingLibrary _ as x) -> Some (n,x)
| n, OpenedModule (it,e,op,_) ->
Some(n,OpenedModule(it,e,op,Summary.empty_frozen))
- | n, ClosedModule _ -> Some (n,ClosedModule [])
| n, OpenedSection (op, _) ->
- Some(n,OpenedSection(op,Summary.empty_frozen))
- | n, ClosedSection _ -> Some (n,ClosedSection []))
+ Some(n,OpenedSection(op,Summary.empty_frozen)))
!lib_state.lib_stk in
{ !lib_state with lib_stk }
| _ ->