diff options
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; |
