summaryrefslogtreecommitdiff
path: root/parse/parse.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-07 23:17:14 -0700
committerOri Bernstein <ori@eigenstate.org>2017-08-08 20:56:59 -0700
commit890ecfa3dc504d7f302faab58722cc196dd0979f (patch)
tree315caf735d222fef152e887a6849997ceae21553 /parse/parse.h
parentb53309d883b5facd81d37606c49b432833f32b72 (diff)
downloadmc-890ecfa3dc504d7f302faab58722cc196dd0979f.tar.gz
Bring back enforced namespaces.
It turns out that people actually like being forced to type the full names. Go figure. It does have the benefit of adding pressure to keep package names short. Eventually, we'll probably grow the ability to alias a package at import. We'll see how that goes. This reverts commit c5245eaa80064b77186fa286f8e5e8bca73309ab.
Diffstat (limited to 'parse/parse.h')
-rw-r--r--parse/parse.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/parse/parse.h b/parse/parse.h
index 74abae4..1fc3ac9 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -97,14 +97,13 @@ struct Stab {
char *name;
char isfunc;
- /* symbols */
- Htab *dcl; /* decls */
+ /* Contents of stab.
+ * types and values are in separate namespaces. */
+ Htab *dcl;
+ Htab *env; /* the syms we close over, if we're a function */
Htab *ty; /* types */
Htab *tr; /* traits */
Htab *uc; /* union constructors */
-
- /* not quite symbols */
- Htab *env; /* the syms closed over, if this is a function stab */
Htab *lbl; /* labels */
Htab *impl; /* trait implementations: really a set of implemented traits. */
@@ -410,16 +409,15 @@ void forcedcl(Stab *st, Node *dcl);
void putucon(Stab *st, Ucon *uc);
void putlbl(Stab *st, char *name, Node *lbl);
-void *getnsdcl(Stab *st, Node *n);
-Node *getdcl(Stab *st, Node *n);
-Type *gettype(Stab *st, Node *n);
-Trait *gettrait(Stab *st, Node *n);
-Ucon *getucon(Stab *st, Node *n);
-
Stab *getns(Node *file, char *n);
+Node *getdcl(Stab *st, Node *n);
Node *getclosed(Stab *st, Node *n);
Node **getclosure(Stab *st, size_t *n);
+Type *gettype_l(Stab *st, Node *n);
+Type *gettype(Stab *st, Node *n);
Node *getimpl(Stab *st, Node *impl);
+Trait *gettrait(Stab *st, Node *n);
+Ucon *getucon(Stab *st, Node *n);
Node *getlbl(Stab *st, Srcloc loc, char *name);
Stab *curstab(void);