diff --git a/src/installed_dune_file.ml b/src/installed_dune_file.ml index a1afb4a6..803a4918 100644 --- a/src/installed_dune_file.ml +++ b/src/installed_dune_file.ml @@ -57,11 +57,10 @@ let load fname = | t -> loop (t :: acc) end in + let loc = Sexp.Loc.of_lexbuf lexbuf in match loop [] with - | [Lparen; Atom (A "dune"); Atom s] -> - (Sexp.Loc.of_lexbuf lexbuf, Sexp.Atom.to_string s) - | _ -> - Loc.fail (Sexp.Loc.of_lexbuf lexbuf) "%s" bad_dune_file + | [Lparen; Atom (A "dune"); Atom s] -> (loc, Sexp.Atom.to_string s) + | _ -> Loc.fail loc "%s" bad_dune_file in let (lexer, syntax) = match version with