Set version when parsing dune files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
8390af90e4
commit
bedad1f689
|
@ -63,13 +63,15 @@ 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 =
|
let (lexer, syntax) =
|
||||||
match version with
|
match version with
|
||||||
| "1" -> Sexp.Lexer.jbuild_token
|
| "1" -> (Sexp.Lexer.jbuild_token, (0, 0))
|
||||||
| "2" -> Sexp.Lexer.token
|
| "2" -> (Sexp.Lexer.token, (1, 0))
|
||||||
| _ -> Loc.fail version_loc "unknown version %S" version
|
| _ -> Loc.fail version_loc "unknown version %S" version
|
||||||
in
|
in
|
||||||
Sexp.Of_sexp.parse of_sexp Univ_map.empty lexer ~mode:Single fname
|
Sexp.Of_sexp.parse of_sexp
|
||||||
|
(Univ_map.singleton (Syntax.key Stanza.syntax) syntax)
|
||||||
|
(Io.Sexp.load ~lexer ~mode:Single fname))
|
||||||
|
|
||||||
let gen confs =
|
let gen confs =
|
||||||
let sexps =
|
let sexps =
|
||||||
|
|
Loading…
Reference in New Issue