diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-05 16:38:24 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-05 16:38:42 -0400 |
| commit | 0e40fc46d1e96a96f9cb751ef4a47bf1d4df215b (patch) | |
| tree | a9754df47a635de6109d03d552340384bc181301 /src/dump_analysis.cpp | |
| parent | 19c2474b342aa8f4e6f3dc846f3475016d713329 (diff) | |
| download | zig-0e40fc46d1e96a96f9cb751ef4a47bf1d4df215b.tar.gz zig-0e40fc46d1e96a96f9cb751ef4a47bf1d4df215b.zip | |
generated docs: show public stuff only
Diffstat (limited to 'src/dump_analysis.cpp')
| -rw-r--r-- | src/dump_analysis.cpp | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/src/dump_analysis.cpp b/src/dump_analysis.cpp index b110e0e038..220019c184 100644 --- a/src/dump_analysis.cpp +++ b/src/dump_analysis.cpp @@ -650,22 +650,46 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) { // TODO break; } - jw_object_field(jw, "decls"); - 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; + { + jw_object_field(jw, "pubDecls"); + 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 == VisibModPub) { + jw_array_elem(jw); + anal_dump_decl_ref(ctx, tld); + } + } + jw_end_array(jw); + } - jw_array_elem(jw); - anal_dump_decl_ref(ctx, tld); + { + 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); } - jw_end_array(jw); if (ty->data.structure.root_struct != nullptr) { Buf *path_buf = ty->data.structure.root_struct->path; |
