Allow the checking of definition modules

This commit is contained in:
ceriel
1988-01-22 12:04:27 +00:00
parent 03e1f5dc93
commit ca166d25e9
4 changed files with 13 additions and 8 deletions

View File

@@ -137,7 +137,7 @@ DefinitionModule
df->df_flags |= ForeignFlag;
if (!Defined) Defined = df;
CurrentScope->sc_definedby = df;
if (df->df_idf != DefId) {
if (DefId && df->df_idf != DefId) {
error("DEFINITION MODULE name is \"%s\", not \"%s\"",
df->df_idf->id_text, DefId->id_text);
}
@@ -239,8 +239,12 @@ ProgramModule
;
Module:
DEFINITION
{ fatal("Compiling a definition module"); }
{ error("Compiling a definition module");
open_scope(CLOSEDSCOPE);
state = DEFINITION;
}
DefinitionModule
{ close_scope(SC_CHKFORW); }
| %default
[
IMPLEMENTATION { state = IMPLEMENTATION; }