Skip to content

Commit ec87ab9

Browse files
anmonteirojaredly
authored andcommitted
Look for public_name too when figuring out a dune library name (#208)
Since ocaml/dune#1041, `name` is optional in Dune whenever `public_name` has been specified.
1 parent 1be01f0 commit ec87ab9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

util/JbuildFile.re

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ let rec show = item => switch item {
1111
let rec getNamedIdent = items => switch items {
1212
| [] => None
1313
| [`List([`Ident("name"), `Ident(s)]), ..._] => Some(s)
14-
| [`List([`Ident("name"), ..._]), ...rest] => {
14+
| [`List([`Ident("name"), ..._]), ...rest] =>
15+
getNamedIdent(rest)
16+
| [`List([`Ident("public_name"), `Ident(s)]), ..._] => Some(s)
17+
| [`List([`Ident("public_name"), ..._]), ...rest] =>
1518
getNamedIdent(rest)
16-
}
1719
| [_, ...rest] => getNamedIdent(rest)
1820
};
1921

0 commit comments

Comments
 (0)