summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-31 00:43:57 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-31 00:43:57 -0700
commitcc3afe8080e433d68406cf51615a9530ecbbba68 (patch)
tree256989ab21227dfa8867cb5633394c96526a6eb8 /parse
parentae65514eb5853c11042cdeba8bc408b68798c59c (diff)
downloadmc-cc3afe8080e433d68406cf51615a9530ecbbba68.tar.gz
Loop uniformly in export.
Diffstat (limited to 'parse')
-rw-r--r--parse/export.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/parse/export.c b/parse/export.c
index 8650cea..6d50c45 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -260,26 +260,24 @@ tagexports(Node *file, int hidelocal)
/* tag the traits */
tr = NULL;
- k = htkeys(st->tr, &n);
- for (j = 0; j < n; j++) {
- tr = gettrait(st, k[j]);
+ for (i = 0; i < ntraittab; i++) {
+ tr = traittab[i];
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->nproto; i++) {
- tr->proto[i]->decl.vis = tr->vis;
- tagnode(st, tr->proto[i], 0, hidelocal);
+ for (j = 0; j < tr->naux; j++)
+ tr->aux[j]->vis = tr->vis;
+ for (j = 0; j < tr->nproto; j++) {
+ tr->proto[j]->decl.vis = tr->vis;
+ tagnode(st, tr->proto[j], 0, hidelocal);
}
}
- free(k);
/* tag the impls */
- for (i = 0; i < file->file.nimpl; i++) {
- s = file->file.impl[i];
+ for (i = 0; i < nimpltab; i++) {
+ s = impltab[i];
if (s->impl.vis != Visexport)
continue;
tagnode(st, s, 0, hidelocal);