summaryrefslogtreecommitdiff
path: root/parse/dump.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-15 00:36:08 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-15 00:36:42 -0700
commit357f87c1117edfdf77411781ebfae221a406c454 (patch)
tree5e70ba66596b8ee13ceb46e2c9268fe12101f17a /parse/dump.c
parent15b5fb5c0f9fee25b01a245229efcef21c103bdc (diff)
downloadmc-357f87c1117edfdf77411781ebfae221a406c454.tar.gz
Type binding refactoring now compiles.
Still a bit sloppy on a few things, needs some dedup work, but it's working.
Diffstat (limited to 'parse/dump.c')
-rw-r--r--parse/dump.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/parse/dump.c b/parse/dump.c
index 463c732..f84eea1 100644
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -103,6 +103,26 @@ outstab(Stab *st, FILE *fd, int depth)
}
}
+static void
+outenv(Tyenv *e, FILE *fd, int depth)
+{
+ size_t n, i;
+ void **k;
+ Type *t;
+ char *s;
+
+ if (e->tab) {
+ k = htkeys(e->tab, &n);
+ for (i = 0; i < n; i++) {
+ t = htget(e->tab, k[i]);
+ s = tystr(t);
+ findentf(fd, depth + 1, "B %s\n", s);
+ free(s);
+ }
+ free(k);
+ }
+}
+
void
dumpstab(Stab *st, FILE *fd)
{
@@ -110,6 +130,12 @@ dumpstab(Stab *st, FILE *fd)
}
void
+dumpenv(Tyenv *e, FILE *fd)
+{
+ outenv(e, fd, 0);
+}
+
+void
dumpfilestabs(Node *file, int depth, FILE *fd)
{
size_t nk, i;