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. --- printing/pputils.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'printing/pputils.ml') diff --git a/printing/pputils.ml b/printing/pputils.ml index a544b47623..e779fc5fc0 100644 --- a/printing/pputils.ml +++ b/printing/pputils.ml @@ -24,9 +24,11 @@ let pr_located pr (loc, x) = before ++ x ++ after | _ -> pr x +let pr_ast pr { CAst.loc; v } = pr_located pr (loc, v) + let pr_or_var pr = function | ArgArg x -> pr x - | ArgVar (_,s) -> Names.Id.print s + | ArgVar {CAst.v=s} -> Names.Id.print s let pr_with_occurrences pr keyword (occs,c) = match occs with -- cgit v1.2.3