| ... | @@ -572,7 +572,7 @@ const NAV_MODES = { | ... | @@ -572,7 +572,7 @@ const NAV_MODES = { |
| 572 | for (let i = 0; i < curNav.declNames.length; i += 1) { | 572 | for (let i = 0; i < curNav.declNames.length; i += 1) { |
| 573 | let childDecl = findSubDecl(currentType, curNav.declNames[i]); | 573 | let childDecl = findSubDecl(currentType, curNav.declNames[i]); |
| 574 | window.last_decl = childDecl; | 574 | window.last_decl = childDecl; |
| 575 | if (childDecl == null) { | 575 | if (childDecl == null || childDecl.is_private === true) { |
| 576 | return render404(); | 576 | return render404(); |
| 577 | } | 577 | } |
| 578 | lastDecl = childDecl; | 578 | lastDecl = childDecl; |
| ... | @@ -995,9 +995,15 @@ const NAV_MODES = { | ... | @@ -995,9 +995,15 @@ const NAV_MODES = { |
| 995 | return navLink(curNav.modNames, declPath); | 995 | return navLink(curNav.modNames, declPath); |
| 996 | } | 996 | } |
| 997 | | 997 | |
| 998 | if (findSubDecl(curDecl, declName) != null) { | 998 | const subDecl = findSubDecl(curDecl, declName); |
| 999 | const declPath = curNav.declNames.slice(0, i).concat([declName]); | 999 | |
| 1000 | return navLink(curNav.modNames, declPath); | 1000 | if (subDecl != null) { |
| | 1001 | if (subDecl.is_private === true) { |
| | 1002 | return sourceFileLink(subDecl); |
| | 1003 | } else { |
| | 1004 | const declPath = curNav.declNames.slice(0, i).concat([declName]); |
| | 1005 | return navLink(curNav.modNames, declPath); |
| | 1006 | } |
| 1001 | } | 1007 | } |
| 1002 | } | 1008 | } |
| 1003 | | 1009 | |
| ... | @@ -3318,6 +3324,25 @@ const NAV_MODES = { | ... | @@ -3318,6 +3324,25 @@ const NAV_MODES = { |
| 3318 | } | 3324 | } |
| 3319 | } | 3325 | } |
| 3320 | | 3326 | |
| | 3327 | if (parentType.privDecls) { |
| | 3328 | for (let i = 0; i < parentType.privDecls.length; i += 1) { |
| | 3329 | let declIndex = parentType.privDecls[i]; |
| | 3330 | let childDecl = getDecl(declIndex); |
| | 3331 | if (childDecl.name === childName) { |
| | 3332 | childDecl.find_subdecl_idx = declIndex; |
| | 3333 | childDecl.is_private = true; |
| | 3334 | return childDecl; |
| | 3335 | } else if (childDecl.is_uns) { |
| | 3336 | let declValue = resolveValue(childDecl.value); |
| | 3337 | if (!("type" in declValue.expr)) continue; |
| | 3338 | let uns_container = getType(declValue.expr.type); |
| | 3339 | let uns_res = findSubDecl(uns_container, childName); |
| | 3340 | uns_res.is_private = true; |
| | 3341 | if (uns_res !== null) return uns_res; |
| | 3342 | } |
| | 3343 | } |
| | 3344 | } |
| | 3345 | |
| 3321 | return null; | 3346 | return null; |
| 3322 | } | 3347 | } |
| 3323 | | 3348 | |