diff --git a/src/dump_analysis.cpp b/src/dump_analysis.cpp index 3522dcf6f47b24752c134f1832b3ede0b92fe599..fe0052509f572e20a44e0646ead6b2e00d88d605 100644 --- a/src/dump_analysis.cpp +++ b/src/dump_analysis.cpp @@ -1218,6 +1218,10 @@ void zig_print_analysis_dump(CodeGen *g, FILE *f, const char *one_indent, const jw_object_field(jw, "rootPkg"); anal_dump_pkg_ref(&ctx, g->main_pkg); + // FIXME: Remove this ugly workaround. + // Right now the code in docs/main.js relies on the root of the main package being itself. + g->main_pkg->package_table.put(buf_create_from_str("root"), g->main_pkg); + // Poke the functions for (size_t i = 0; i < g->fn_defs.length; i += 1) { ZigFn *fn = g->fn_defs.at(i);