summaryrefslogtreecommitdiff
path: root/parse/export.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-04-21 23:36:08 -0700
committerOri Bernstein <ori@eigenstate.org>2017-04-21 23:36:08 -0700
commitb0b7605bb866cccae5ea15cb9b8b18524ecc84d6 (patch)
tree88d551cabc27e09b216a629fac722072ea395480 /parse/export.c
parent69823fb059b309c0d78b819ea331489c206b83b3 (diff)
downloadmc-b0b7605bb866cccae5ea15cb9b8b18524ecc84d6.tar.gz
Clean up export tagging code.
Diffstat (limited to 'parse/export.c')
-rw-r--r--parse/export.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/parse/export.c b/parse/export.c
index 8bb5809..ba85219 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -250,22 +250,24 @@ void tagexports(Node *file, int hidelocal)
/* tag the traits */
free(k);
- tr = NULL;
+ tr = NULL;
k = htkeys(st->tr, &n);
for (j = 0; j < n; j++) {
tr = gettrait(st, k[j]);
- if (tr->vis == Visexport) {
- tr->param->vis = Visexport;
- for (i = 0; i < tr->naux; i++)
- tr->aux[i]->vis = Visexport;
- for (i = 0; i < tr->nmemb; i++) {
- tr->memb[i]->decl.vis = Visexport;
- tagnode(st, tr->memb[i], 0, hidelocal);
- }
- for (i = 0; i < tr->nfuncs; i++) {
- tr->funcs[i]->decl.vis = Visexport;
- tagnode(st, tr->funcs[i], 0, hidelocal);
- }
+ if (tr->vis != Visexport)
+ continue;
+ if (hidelocal && tr->ishidden)
+ tr->vis = Vishidden;
+ tr->param->vis = tr->vis;
+ for (i = 0; i < tr->naux; i++)
+ tr->aux[i]->vis = tr->vis;
+ for (i = 0; i < tr->nmemb; i++) {
+ tr->memb[i]->decl.vis = tr->vis;
+ tagnode(st, tr->memb[i], 0, hidelocal);
+ }
+ for (i = 0; i < tr->nfuncs; i++) {
+ tr->funcs[i]->decl.vis = tr->vis;
+ tagnode(st, tr->funcs[i], 0, hidelocal);
}
}
free(k);