| author | |
| committer | |
| log | 0e40fc46d1e96a96f9cb751ef4a47bf1d4df215b |
| tree | a9754df47a635de6109d03d552340384bc181301 |
| parent | 19c2474b342aa8f4e6f3dc846f3475016d713329 |
| signature |
2 files changed, 43 insertions(+), 19 deletions(-)
lib/std/special/doc/main.js+6-6| ... | ... | @@ -90,7 +90,7 @@ |
| 90 | 90 | renderPkgList(lastPkg); |
| 91 | 91 | |
| 92 | 92 | var lastDecl = curNav.declObjs[curNav.declObjs.length - 1]; |
| 93 | if (lastDecl.decls != null) { | |
| 93 | if (lastDecl.pubDecls != null) { | |
| 94 | 94 | return renderContainer(lastDecl); |
| 95 | 95 | } else if (lastDecl.type != null) { |
| 96 | 96 | var typeObj = zigAnalysis.types[lastDecl.type]; |
| ... | ... | @@ -220,8 +220,8 @@ |
| 220 | 220 | function renderContainer(container) { |
| 221 | 221 | var typesList = []; |
| 222 | 222 | var fnsList = []; |
| 223 | for (var i = 0; i < container.decls.length; i += 1) { | |
| 224 | var decl = zigAnalysis.decls[container.decls[i]]; | |
| 223 | for (var i = 0; i < container.pubDecls.length; i += 1) { | |
| 224 | var decl = zigAnalysis.decls[container.pubDecls[i]]; | |
| 225 | 225 | if (decl.type != null) { |
| 226 | 226 | if (decl.type == typeTypeId) { |
| 227 | 227 | typesList.push(decl); |
| ... | ... | @@ -332,9 +332,9 @@ |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | function findSubDecl(parentType, childName) { |
| 335 | if (parentType.decls == null) throw new Error("parent object has no decls"); | |
| 336 | for (var i = 0; i < parentType.decls.length; i += 1) { | |
| 337 | var declIndex = parentType.decls[i]; | |
| 335 | if (parentType.pubDecls == null) throw new Error("parent object has no public decls"); | |
| 336 | for (var i = 0; i < parentType.pubDecls.length; i += 1) { | |
| 337 | var declIndex = parentType.pubDecls[i]; | |
| 338 | 338 | var childDecl = zigAnalysis.decls[declIndex]; |
| 339 | 339 | if (childDecl.name === childName) { |
| 340 | 340 | return childDecl; |
src/dump_analysis.cpp+37-13| ... | ... | @@ -650,22 +650,46 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) { |
| 650 | 650 | // TODO |
| 651 | 651 | break; |
| 652 | 652 | } |
| 653 | jw_object_field(jw, "decls"); | |
| 654 | jw_begin_array(jw); | |
| 655 | 653 | |
| 656 | ScopeDecls *decls_scope = ty->data.structure.decls_scope; | |
| 657 | auto it = decls_scope->decl_table.entry_iterator(); | |
| 658 | for (;;) { | |
| 659 | auto *entry = it.next(); | |
| 660 | if (!entry) | |
| 661 | break; | |
| 662 | ||
| 663 | Tld *tld = entry->value; | |
| 654 | { | |
| 655 | jw_object_field(jw, "pubDecls"); | |
| 656 | jw_begin_array(jw); | |
| 657 | ||
| 658 | ScopeDecls *decls_scope = ty->data.structure.decls_scope; | |
| 659 | auto it = decls_scope->decl_table.entry_iterator(); | |
| 660 | for (;;) { | |
| 661 | auto *entry = it.next(); | |
| 662 | if (!entry) | |
| 663 | break; | |
| 664 | ||
| 665 | Tld *tld = entry->value; | |
| 666 | if (tld->visib_mod == VisibModPub) { | |
| 667 | jw_array_elem(jw); | |
| 668 | anal_dump_decl_ref(ctx, tld); | |
| 669 | } | |
| 670 | } | |
| 671 | jw_end_array(jw); | |
| 672 | } | |
| 664 | 673 | |
| 665 | jw_array_elem(jw); | |
| 666 | anal_dump_decl_ref(ctx, tld); | |
| 674 | { | |
| 675 | jw_object_field(jw, "privDecls"); | |
| 676 | jw_begin_array(jw); | |
| 677 | ||
| 678 | ScopeDecls *decls_scope = ty->data.structure.decls_scope; | |
| 679 | auto it = decls_scope->decl_table.entry_iterator(); | |
| 680 | for (;;) { | |
| 681 | auto *entry = it.next(); | |
| 682 | if (!entry) | |
| 683 | break; | |
| 684 | ||
| 685 | Tld *tld = entry->value; | |
| 686 | if (tld->visib_mod == VisibModPrivate) { | |
| 687 | jw_array_elem(jw); | |
| 688 | anal_dump_decl_ref(ctx, tld); | |
| 689 | } | |
| 690 | } | |
| 691 | jw_end_array(jw); | |
| 667 | 692 | } |
| 668 | jw_end_array(jw); | |
| 669 | 693 | |
| 670 | 694 | if (ty->data.structure.root_struct != nullptr) { |
| 671 | 695 | Buf *path_buf = ty->data.structure.root_struct->path; |