aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/extraction
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2018-02-25 22:43:42 +0100
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2018-03-09 23:28:09 +0100
commitb1d749e59444f86e40f897c41739168bb1b1b9b3 (patch)
treeade1ab73a9c2066302145bb3781a39b5d46b4513 /plugins/extraction
parent4af41a12a0e7e6b17d25a71568641bd03d5e1f94 (diff)
[located] Push inner locations in `reference` to a CAst.t node.
The `reference` type contains some ad-hoc locations in its constructors, but there is no reason not to handle them with the standard attribute container provided by `CAst.t`. An orthogonal topic to this commit is whether the `reference` type should contain a location or not at all. It seems that many places would become a bit clearer by splitting `reference` into non-located `reference` and `lreference`, however some other places become messier so we maintain the current status-quo for now.
Diffstat (limited to 'plugins/extraction')
-rw-r--r--plugins/extraction/extract_env.ml8
-rw-r--r--plugins/extraction/table.ml2
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/extraction/extract_env.ml b/plugins/extraction/extract_env.ml
index a4e8c44cd..397cb2920 100644
--- a/plugins/extraction/extract_env.ml
+++ b/plugins/extraction/extract_env.ml
@@ -597,8 +597,8 @@ let warns () =
let rec locate_ref = function
| [] -> [],[]
| r::l ->
- let q = snd (qualid_of_reference r) in
- let mpo = try Some (Nametab.locate_module q) with Not_found -> None
+ let q = qualid_of_reference r in
+ let mpo = try Some (Nametab.locate_module q.CAst.v) with Not_found -> None
and ro =
try Some (Smartlocate.global_with_alias r)
with Nametab.GlobalizationError _ | UserError _ -> None
@@ -608,7 +608,7 @@ let rec locate_ref = function
| None, Some r -> let refs,mps = locate_ref l in r::refs,mps
| Some mp, None -> let refs,mps = locate_ref l in refs,mp::mps
| Some mp, Some r ->
- warning_ambiguous_name (q,mp,r);
+ warning_ambiguous_name (q.CAst.v,mp,r);
let refs,mps = locate_ref l in refs,mp::mps
(*s Recursive extraction in the Coq toplevel. The vernacular command is
@@ -646,7 +646,7 @@ let separate_extraction lr =
is \verb!Extraction! [qualid]. *)
let simple_extraction r =
- Vernacentries.dump_global (Misctypes.AN r);
+ Vernacentries.dump_global CAst.(make (Misctypes.AN r));
match locate_ref [r] with
| ([], [mp]) as p -> full_extr None p
| [r],[] ->
diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml
index 6c421491f..54c6d9d72 100644
--- a/plugins/extraction/table.ml
+++ b/plugins/extraction/table.ml
@@ -899,7 +899,7 @@ let extract_constant_inline inline r ids s =
let extract_inductive r s l optstr =
check_inside_section ();
let g = Smartlocate.global_with_alias r in
- Dumpglob.add_glob ?loc:(loc_of_reference r) g;
+ Dumpglob.add_glob ?loc:r.CAst.loc g;
match g with
| IndRef ((kn,i) as ip) ->
let mib = Global.lookup_mind kn in