diff options
| author | Pierre-Marie Pédrot | 2016-10-12 21:14:07 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2016-10-12 21:14:07 +0200 |
| commit | 05ad4f49ac2203dd64dfec79a1fc62ee52115724 (patch) | |
| tree | 920faae7946821c093345fd1804c40336bd9f1c4 /printing/pputils.ml | |
| parent | 8a6c792505160de4ba2123ef049ab45d28873e47 (diff) | |
| parent | 0222f685ebdd55a1596d6689b96ebb86454ba1a7 (diff) | |
Merge branch 'v8.6'
Diffstat (limited to 'printing/pputils.ml')
| -rw-r--r-- | printing/pputils.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/printing/pputils.ml b/printing/pputils.ml index 33382fe838..4916889139 100644 --- a/printing/pputils.ml +++ b/printing/pputils.ml @@ -17,7 +17,11 @@ open Genredexpr let pr_located pr (loc, x) = if Flags.do_beautify () && loc <> Loc.ghost then let (b, e) = Loc.unloc loc in - Pp.comment b ++ pr x ++ Pp.comment e + (* Side-effect: order matters *) + let before = Pp.comment (CLexer.extract_comments b) in + let x = pr x in + let after = Pp.comment (CLexer.extract_comments e) in + before ++ x ++ after else pr x let pr_or_var pr = function |
