From a11973010eec20db39abf114d5a022b5bddfe711 Mon Sep 17 00:00:00 2001 From: Patrick Ferris Date: Sun, 24 Nov 2024 19:22:59 +0000 Subject: [PATCH] Match compiler dummy position We match the OCaml compiler's dummy position for default locations when using `Location.in_file`. Signed-off-by: Patrick Ferris --- src/location.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/location.ml b/src/location.ml index 54daa6397..9a43eb8d1 100644 --- a/src/location.ml +++ b/src/location.ml @@ -8,7 +8,8 @@ type t = location = { } let in_file name = - let loc = { pos_fname = name; pos_lnum = 1; pos_bol = 0; pos_cnum = -1 } in + (* This position matches the compiler's [dummy_pos]. *) + let loc = { pos_fname = name; pos_lnum = 0; pos_bol = 0; pos_cnum = -1 } in { loc_start = loc; loc_end = loc; loc_ghost = true } let set_filename loc fn =