summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-04-12 22:48:43 -0700
committerOri Bernstein <ori@eigenstate.org>2019-04-12 22:48:43 -0700
commit537313ee9a2179cc6e869c6e8c70da4af1f07f28 (patch)
tree6cc091ad8c73b5e71755c6f4977de8d0e1d98fd1 /parse/node.c
parent6940a02fd47d73ba5dd0ad3a82b1945b639a23dc (diff)
downloadmc-537313ee9a2179cc6e869c6e8c70da4af1f07f28.tar.gz
Rename traits correctly.
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/parse/node.c b/parse/node.c
index 9ff3975..bf40143 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -30,6 +30,18 @@ lnum(Srcloc l)
return l.line;
}
+void
+initfile(File *f, char *name)
+{
+ memset(f, 0, sizeof(*f));
+ f->builtins = mkstab(0);
+ f->globls = mkstab(0);
+ f->globls->super = file.builtins;
+ f->ns = mkht(strhash, streq);
+ lappend(&f->files, &f->nfiles, name);
+ tyinit(f->builtins);
+}
+
/*
* Bah, this is going to need to know how to fold things.
* FIXME: teach it.