summaryrefslogtreecommitdiff
path: root/parsing
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2022-04-06 15:25:24 +0100
committerDavid Allsopp <david.allsopp@metastack.com>2022-05-24 14:10:09 +0100
commit2986a94fa2603db5cca748d1bdbc7edae98c46d7 (patch)
treefa12504fccab1448e6dad8164ef3e6f77e95fb70 /parsing
parentf68c29519326d214e11bc6a84328b1da29ce14fd (diff)
downloadocaml-2986a94fa2603db5cca748d1bdbc7edae98c46d7.tar.gz
Add Warnings.ghost_loc_in_file
Factors out some common usage between Warnings and Location for zero-length ghost locations.
Diffstat (limited to 'parsing')
-rw-r--r--parsing/location.ml4
1 files changed, 1 insertions, 3 deletions
diff --git a/parsing/location.ml b/parsing/location.ml
index 209797a3f5..d97d43d9c3 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -18,9 +18,7 @@ open Lexing
type t = Warnings.loc =
{ loc_start: position; loc_end: position; loc_ghost: bool }
-let in_file name =
- let loc = { dummy_pos with pos_fname = name } in
- { loc_start = loc; loc_end = loc; loc_ghost = true }
+let in_file = Warnings.ghost_loc_in_file
let none = in_file "_none_"
let is_none l = (l = none)