authorgravatar for timonkruiper@gmail.comTimon Kruiper <timonkruiper@gmail.com> 2020-04-10 00:51:55+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-10 14:59:51-04:00
log121307679bd1ffeaa8a290a826396662f26a4ac1
tree8968a56f8ac77a0e90e5bb154c9b89c1ef92fb57
parent72dca05f5c60cbb492825f61b5308ff925ce9275

Fix generated docs of user code

fff3c1fff4c3ebfcb2bd4f08a43ae7815b5c446b broke the docs generation for own user code. This adds a workaround, because all the code in docs/main.js is relying on the fact that the root package of the main package is the root package itself.

1 files changed, 4 insertions(+), 0 deletions(-)

src/dump_analysis.cpp+4
......@@ -1218,6 +1218,10 @@ void zig_print_analysis_dump(CodeGen *g, FILE *f, const char *one_indent, const
12181218 jw_object_field(jw, "rootPkg");
12191219 anal_dump_pkg_ref(&ctx, g->main_pkg);
12201220
1221 // FIXME: Remove this ugly workaround.
1222 // Right now the code in docs/main.js relies on the root of the main package being itself.
1223 g->main_pkg->package_table.put(buf_create_from_str("root"), g->main_pkg);
1224
12211225 // Poke the functions
12221226 for (size_t i = 0; i < g->fn_defs.length; i += 1) {
12231227 ZigFn *fn = g->fn_defs.at(i);