From 938db899abbacc57c33dff5855c8ef2bd4a81d56 Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Sat, 1 Jun 2019 17:53:24 +0100 Subject: [PATCH] Support recent versions of OCaml, which default to -safe-string --- location.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/location.ml b/location.ml index 0430196..bd50349 100644 --- a/location.ml +++ b/location.ml @@ -43,8 +43,11 @@ let slurp chan = | n -> read_all (Bytes.sub buf 0 n :: chunks) in read_all [] +let slurp_string chan = + Bytes.to_string (slurp chan) + let of_file fname = - source fname (slurp (open_in fname)) + source fname (slurp_string (open_in fname)) let of_string str = source "" str