summaryrefslogtreecommitdiff
path: root/parse/parse.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-27 01:11:33 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-27 01:57:52 -0700
commitc5245eaa80064b77186fa286f8e5e8bca73309ab (patch)
tree3dbaf773b4cc3c1a501f12805c7d3bee2e3f81ad /parse/parse.h
parent0087d35b4f6393aa46c5ac757f77c5087f2add19 (diff)
downloadmc-c5245eaa80064b77186fa286f8e5e8bca73309ab.tar.gz
std.change std.name std.lookup std.rules.
std.no std.on std.every std.name std.you std.use. The rules for an un-namespaced name now are as follows: 1) Attempt to look up a name in the current file. 2) Check all namespaces for a unique name. If the name is not globally unique, give an error.
Diffstat (limited to 'parse/parse.h')
-rw-r--r--parse/parse.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/parse/parse.h b/parse/parse.h
index 07ec44a..90fd2fe 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -90,13 +90,14 @@ struct Stab {
char *name;
char isfunc;
- /* Contents of stab.
- * types and values are in separate namespaces. */
- Htab *dcl;
- Htab *env; /* the syms we close over, if we're a function */
+ /* symbols */
+ Htab *dcl; /* decls */
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. */
};
@@ -396,15 +397,16 @@ void forcedcl(Stab *st, Node *dcl);
void putucon(Stab *st, Ucon *uc);
void putlbl(Stab *st, char *name, Node *lbl);
-Stab *getns(Node *file, char *n);
+void *getnsdcl(Stab *st, Node *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);
+
+Stab *getns(Node *file, char *n);
+Node *getclosed(Stab *st, Node *n);
+Node **getclosure(Stab *st, size_t *n);
+Node *getimpl(Stab *st, Node *impl);
Node *getlbl(Stab *st, Srcloc loc, char *name);
Stab *curstab(void);