File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,8 @@ type what =
292
292
| `With_type of Cfrag .type_
293
293
| `Module_type_expr of Component.ModuleType .expr
294
294
| `Module_type_u_expr of Component.ModuleType .U .expr
295
- | `Child of Reference .t
295
+ | `Child_module of string
296
+ | `Child_page of string
296
297
| `Reference of Reference .t ]
297
298
298
299
let report ~(what : what ) ?tools_error action =
@@ -339,7 +340,8 @@ let report ~(what : what) ?tools_error action =
339
340
r " module type expression" module_type_expr cexpr
340
341
| `Module_type_u_expr cexpr ->
341
342
r " module type u expression" u_module_type_expr cexpr
342
- | `Child rf -> r " child reference" model_reference rf
343
+ | `Child_module rf -> r " child module" Astring.String. pp rf
344
+ | `Child_page rf -> r " child page" Astring.String. pp rf
343
345
| `Reference ref -> r " reference" model_reference ref
344
346
in
345
347
match kind_of_error ~what tools_error with
Original file line number Diff line number Diff line change @@ -1010,6 +1010,23 @@ let link ~filename x y =
1010
1010
if y.Lang.Compilation_unit. linked || y.hidden then y else unit x y)
1011
1011
1012
1012
let page env page =
1013
+ let () =
1014
+ List. iter
1015
+ (fun child ->
1016
+ let check_resolves ~what f name =
1017
+ match f name env with
1018
+ | Some _ -> ()
1019
+ | None -> Errors. report ~what `Lookup
1020
+ in
1021
+ match child with
1022
+ | Page. Source_tree_child _ -> ()
1023
+ | Page. Page_child page ->
1024
+ check_resolves ~what: (`Child_page page) Env. lookup_page page
1025
+ | Page. Module_child mod_ ->
1026
+ check_resolves ~what: (`Child_module mod_) Env. lookup_root_module
1027
+ mod_)
1028
+ page.Lang.Page. children
1029
+ in
1013
1030
{
1014
1031
page with
1015
1032
Page. content = comment_docs env page.Page. name page.content;
Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ Parents must be pages
29
29
Linking checks the children are all present:
30
30
$ odoc compile top1. mld -- child foo
31
31
$ odoc link page-top1. odoc -I .
32
+ File " page-top1.odoc" :
33
+ Warning: Failed to lookup child page foo
32
34
You can’t perform that action at this time.
0 commit comments