newer version, safety commit

This commit is contained in:
ceriel
1986-04-02 17:34:21 +00:00
parent 66c571d217
commit b89155a64a
8 changed files with 103 additions and 49 deletions

View File

@@ -21,11 +21,12 @@ number:
qualident(int types; struct def **pdf; char *str;)
{
int scope;
int module;
register struct def *df;
struct def *lookfor();
} :
IDENT { if (types) {
*pdf = df = lookfor(dot.TOK_IDF, 1);
*pdf = df = lookfor(dot.TOK_IDF, currscope, 1);
if (df->df_kind == D_ERROR) types = 0;
}
}
@@ -38,6 +39,7 @@ qualident(int types; struct def **pdf; char *str;)
/* selector */
'.' IDENT
{ if (types) {
module = (df->df_kind == D_MODULE);
df = lookup(dot.TOK_IDF, scope);
if (!df) {
error("identifier \"%s\" not declared",
@@ -45,6 +47,11 @@ qualident(int types; struct def **pdf; char *str;)
types = 0;
df = ill_df;
}
else
if (module &&
!(df->df_flags&(D_EXPORTED|D_QEXPORTED))) {
error("identifier \"%s\" not exported from qualifying module", dot.TOK_IDF->id_text);
}
}
}
]*