Skip to content

Commit 658f0cb

Browse files
authored
Stanza parse remove useless helper (#12708)
refactor: remove/inline some useless stanza helpers Signed-off-by: Rudi Grinberg <[email protected]>
1 parent b72bc1d commit 658f0cb

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

bin/dune_init.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ module File = struct
6060
;;
6161

6262
let csts_conflict project ~dir (a : Cst.t) (b : Cst.t) =
63-
let of_ast = Dune_rules.Stanzas.of_ast project ~dir in
63+
let of_ast sexp =
64+
let parser = Dune_project.stanza_parser project ~dir in
65+
Dune_lang.Decoder.parse parser Univ_map.empty sexp
66+
in
6467
(let open Option.O in
6568
let* a_ast = Cst.abstract a in
6669
let+ b_ast = Cst.abstract b in

src/dune_rules/stanzas/stanzas.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ let stanzas : Stanza.Parser.t list =
117117
;;
118118

119119
let () = Dune_project.Lang.register Stanza.syntax stanzas
120-
let parse parser = Dune_lang.Decoder.parse parser Univ_map.empty
121-
122-
let of_ast (project : Dune_project.t) ~dir sexp =
123-
let parser = Dune_project.stanza_parser project ~dir in
124-
parse parser sexp
125-
;;
126120

127121
let stanza_package stanza =
128122
match

src/dune_rules/stanzas/stanzas.mli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@ module Dynamic_include : sig
1313
end
1414

1515
val stanza_package : Stanza.t -> Package.Id.t option
16-
17-
(** [of_ast project ~dir ast] is the list of [Stanza.t]s derived from decoding
18-
the [ast] according to the syntax given by [kind] in the context of the
19-
[project] *)
20-
val of_ast : Dune_project.t -> dir:Path.Source.t -> Dune_lang.Ast.t -> Stanza.t list

0 commit comments

Comments
 (0)