authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-06-08 18:00:48+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 19:10:12-07:00
logcd357fc7676a86b11a3593d63bd530add91cfd6e
treea3b302872ce17ae8c04d99387241ac0ae2497192
parentd2baf404a550ea61402e2cba131168c6001e8dab

autodoc: fix package issue when analyzing stdlib


1 files changed, 12 insertions(+), 6 deletions(-)

src/Autodoc.zig+12-6
......@@ -1032,12 +1032,18 @@ fn walkInstruction(
10321032
10331033 // Immediately add this package to the import table of our
10341034 // current package, regardless of wether it's new or not.
1035 const current_package = self.packages.getPtr(file.pkg).?;
1036 _ = try current_package.table.data.getOrPutValue(
1037 self.arena,
1038 path,
1039 self.packages.getIndex(other_package).?,
1040 );
1035 if (self.packages.getPtr(file.pkg)) |current_package| {
1036 // TODO: apparently, in the stdlib a file gets analized before
1037 // its package gets added. I guess we're importing a file
1038 // that belongs to another package through its file path?
1039 // (ie not through its package name).
1040 // We're bailing for now, but maybe we shouldn't?
1041 _ = try current_package.table.data.getOrPutValue(
1042 self.arena,
1043 path,
1044 self.packages.getIndex(other_package).?,
1045 );
1046 }
10411047
10421048 if (result.found_existing) {
10431049 return DocData.WalkResult{