From 4af41a12a0e7e6b17d25a71568641bd03d5e1f94 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Wed, 14 Feb 2018 06:57:40 +0100 Subject: [located] More work towards using CAst.t We continue with the work of #402 and #6745 and update most of the remaining parts of the AST: - module declarations - intro patterns - top-level sentences Now, parsed documents should be full annotated by `CAst` nodes. --- vernac/classes.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vernac/classes.ml') diff --git a/vernac/classes.ml b/vernac/classes.ml index 192cc8a55..e074e44a4 100644 --- a/vernac/classes.ml +++ b/vernac/classes.ml @@ -229,8 +229,8 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) | Some (Inl props) -> let get_id = function - | Ident id' -> id' - | Qualid (loc,id') -> (Loc.tag ?loc @@ snd (repr_qualid id')) + | Ident (loc, id') -> CAst.(make ?loc @@ id') + | Qualid (loc,id') -> CAst.(make ?loc @@ snd (repr_qualid id')) in let props, rest = List.fold_left @@ -238,7 +238,7 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) if is_local_assum decl then try let is_id (id', _) = match RelDecl.get_name decl, get_id id' with - | Name id, (_, id') -> Id.equal id id' + | Name id, {CAst.v=id'} -> Id.equal id id' | Anonymous, _ -> false in let (loc_mid, c) = @@ -247,7 +247,7 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) let rest' = List.filter (fun v -> not (is_id v)) rest in - let (loc, mid) = get_id loc_mid in + let {CAst.loc;v=mid} = get_id loc_mid in List.iter (fun (n, _, x) -> if Name.equal n (Name mid) then Option.iter (fun x -> Dumpglob.add_glob ?loc (ConstRef x)) x) -- cgit v1.2.3