Simplify versioning matching

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-07-01 17:00:02 +07:00
parent a4bc260241
commit 8390af90e4
1 changed files with 7 additions and 9 deletions

View File

@ -63,15 +63,13 @@ let load fname =
| _ -> | _ ->
Loc.fail (Sexp.Loc.of_lexbuf lexbuf) "%s" bad_dune_file Loc.fail (Sexp.Loc.of_lexbuf lexbuf) "%s" bad_dune_file
in in
let lexer =
match version with match version with
| "1" -> | "1" -> Sexp.Lexer.jbuild_token
Sexp.Of_sexp.parse of_sexp Univ_map.empty | "2" -> Sexp.Lexer.token
(Io.Sexp.load ~lexer:Sexp.Lexer.jbuild_token ~mode:Single fname) | _ -> Loc.fail version_loc "unknown version %S" version
| "2" -> in
Sexp.Of_sexp.parse of_sexp Univ_map.empty Sexp.Of_sexp.parse of_sexp Univ_map.empty lexer ~mode:Single fname
(Io.Sexp.load ~lexer:Sexp.Lexer.token ~mode:Single fname)
| _ ->
Loc.fail version_loc "unknown version %S" version)
let gen confs = let gen confs =
let sexps = let sexps =