From 9bebbb96e58b3c1b0f7f88ba2af45462eae69b0f Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 10 Dec 2017 09:26:25 +0100 Subject: [ast] Improve precision of Ast location recognition in serialization. We follow the suggestions in #402 and turn uses of `Loc.located` in `vernac` into `CAst.t`. The impact should be low as this change mostly affects top-level vernaculars. With this change, we are even closer to automatically map a text document to its AST in a programmatic way. --- library/declaremods.ml | 5 ++--- library/declaremods.mli | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'library') diff --git a/library/declaremods.ml b/library/declaremods.ml index 28a04252a3..291039d199 100644 --- a/library/declaremods.ml +++ b/library/declaremods.ml @@ -451,7 +451,7 @@ let intern_arg interp_modast (acc, cst) (idl,(typ,ann)) = let env = Global.env () in let sobjs = get_module_sobjs false env inl mty in let mp0 = get_module_path mty in - let fold acc (_, id) = + let fold acc {CAst.v=id} = let dir = DirPath.make [id] in let mbid = MBId.make lib_dir id in let mp = MPbound mbid in @@ -982,8 +982,7 @@ type 'modast module_interpretor = Entries.module_struct_entry * Misctypes.module_kind * Univ.ContextSet.t type 'modast module_params = - (Id.t Loc.located list * ('modast * inline)) list - + (lident list * ('modast * inline)) list (** {6 Debug} *) diff --git a/library/declaremods.mli b/library/declaremods.mli index 0df55f34d7..db28933768 100644 --- a/library/declaremods.mli +++ b/library/declaremods.mli @@ -16,7 +16,7 @@ type 'modast module_interpretor = Entries.module_struct_entry * Misctypes.module_kind * Univ.ContextSet.t type 'modast module_params = - (Id.t Loc.located list * ('modast * inline)) list + (Misctypes.lident list * ('modast * inline)) list (** [declare_module interp_modast id fargs typ exprs] declares module [id], with structure constructed by [interp_modast] -- cgit v1.2.3