newer version
This commit is contained in:
@@ -52,7 +52,9 @@ GetDefinitionModule(id)
|
||||
We may have to read the definition module itself.
|
||||
*/
|
||||
struct def *df;
|
||||
static int level;
|
||||
|
||||
level++;
|
||||
df = lookup(id, GlobalScope);
|
||||
if (!df) {
|
||||
/* Read definition module. Make an exception for SYSTEM.
|
||||
@@ -63,10 +65,19 @@ GetDefinitionModule(id)
|
||||
else {
|
||||
GetFile(id->id_text);
|
||||
DefModule();
|
||||
if (level == 1) {
|
||||
/* The module is directly imported by the
|
||||
currently defined module, so we have to
|
||||
remember its name because we have to call
|
||||
its initialization routine
|
||||
*/
|
||||
AddModule(id);
|
||||
}
|
||||
}
|
||||
df = lookup(id, GlobalScope);
|
||||
}
|
||||
assert(df != 0 && df->df_kind == D_MODULE);
|
||||
level--;
|
||||
return df;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user