Share loc variable

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-07-01 17:09:27 +07:00
parent bedad1f689
commit 7b12e12571
1 changed files with 3 additions and 4 deletions

View File

@ -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