generated docs: show public stuff only
parent
19c2474b34
commit
0e40fc46d1
|
@ -90,7 +90,7 @@
|
|||
renderPkgList(lastPkg);
|
||||
|
||||
var lastDecl = curNav.declObjs[curNav.declObjs.length - 1];
|
||||
if (lastDecl.decls != null) {
|
||||
if (lastDecl.pubDecls != null) {
|
||||
return renderContainer(lastDecl);
|
||||
} else if (lastDecl.type != null) {
|
||||
var typeObj = zigAnalysis.types[lastDecl.type];
|
||||
|
@ -220,8 +220,8 @@
|
|||
function renderContainer(container) {
|
||||
var typesList = [];
|
||||
var fnsList = [];
|
||||
for (var i = 0; i < container.decls.length; i += 1) {
|
||||
var decl = zigAnalysis.decls[container.decls[i]];
|
||||
for (var i = 0; i < container.pubDecls.length; i += 1) {
|
||||
var decl = zigAnalysis.decls[container.pubDecls[i]];
|
||||
if (decl.type != null) {
|
||||
if (decl.type == typeTypeId) {
|
||||
typesList.push(decl);
|
||||
|
@ -332,9 +332,9 @@
|
|||
}
|
||||
|
||||
function findSubDecl(parentType, childName) {
|
||||
if (parentType.decls == null) throw new Error("parent object has no decls");
|
||||
for (var i = 0; i < parentType.decls.length; i += 1) {
|
||||
var declIndex = parentType.decls[i];
|
||||
if (parentType.pubDecls == null) throw new Error("parent object has no public decls");
|
||||
for (var i = 0; i < parentType.pubDecls.length; i += 1) {
|
||||
var declIndex = parentType.pubDecls[i];
|
||||
var childDecl = zigAnalysis.decls[declIndex];
|
||||
if (childDecl.name === childName) {
|
||||
return childDecl;
|
||||
|
|
|
@ -650,7 +650,9 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
|
|||
// TODO
|
||||
break;
|
||||
}
|
||||
jw_object_field(jw, "decls");
|
||||
|
||||
{
|
||||
jw_object_field(jw, "pubDecls");
|
||||
jw_begin_array(jw);
|
||||
|
||||
ScopeDecls *decls_scope = ty->data.structure.decls_scope;
|
||||
|
@ -661,11 +663,33 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
|
|||
break;
|
||||
|
||||
Tld *tld = entry->value;
|
||||
|
||||
if (tld->visib_mod == VisibModPub) {
|
||||
jw_array_elem(jw);
|
||||
anal_dump_decl_ref(ctx, tld);
|
||||
}
|
||||
}
|
||||
jw_end_array(jw);
|
||||
}
|
||||
|
||||
{
|
||||
jw_object_field(jw, "privDecls");
|
||||
jw_begin_array(jw);
|
||||
|
||||
ScopeDecls *decls_scope = ty->data.structure.decls_scope;
|
||||
auto it = decls_scope->decl_table.entry_iterator();
|
||||
for (;;) {
|
||||
auto *entry = it.next();
|
||||
if (!entry)
|
||||
break;
|
||||
|
||||
Tld *tld = entry->value;
|
||||
if (tld->visib_mod == VisibModPrivate) {
|
||||
jw_array_elem(jw);
|
||||
anal_dump_decl_ref(ctx, tld);
|
||||
}
|
||||
}
|
||||
jw_end_array(jw);
|
||||
}
|
||||
|
||||
if (ty->data.structure.root_struct != nullptr) {
|
||||
Buf *path_buf = ty->data.structure.root_struct->path;
|
||||
|
|
Loading…
Reference in New Issue