diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-12-10 09:26:25 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-02-22 00:44:33 +0100 |
commit | 9bebbb96e58b3c1b0f7f88ba2af45462eae69b0f (patch) | |
tree | 24e8de17078242c1ea39e31ecfe55a1c024d0eff /interp/dumpglob.ml | |
parent | 0c5f0afffd37582787f79267d9841259095b7edc (diff) |
[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.
Diffstat (limited to 'interp/dumpglob.ml')
-rw-r--r-- | interp/dumpglob.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/interp/dumpglob.ml b/interp/dumpglob.ml index d7962e29a..e439db2b2 100644 --- a/interp/dumpglob.ml +++ b/interp/dumpglob.ml @@ -249,12 +249,12 @@ let dump_def ?loc ty secpath id = Option.iter (fun loc -> dump_string (Printf.sprintf "%s %d:%d %s %s\n" ty bl el secpath id) ) loc -let dump_definition (loc, id) sec s = +let dump_definition {CAst.loc;v=id} sec s = dump_def ?loc s (Names.DirPath.to_string (Lib.current_dirpath sec)) (Names.Id.to_string id) -let dump_constraint (((loc, n),_), _, _) sec ty = +let dump_constraint (({ CAst.loc; v = n },_), _, _) sec ty = match n with - | Names.Name id -> dump_definition (loc, id) sec ty + | Names.Name id -> dump_definition CAst.(make ?loc id) sec ty | Names.Anonymous -> () let dump_moddef ?loc mp ty = |