Allow the checking of definition modules

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

View file

@ -1 +1 @@
static char Version[] = "ACK Modula-2 compiler Version 0.30";
static char Version[] = "ACK Modula-2 compiler Version 0.31";

View file

@ -71,7 +71,7 @@ DoOption(text)
}
}
}
else warning_classes = 0;
else warning_classes = W_ALWAYS;
break;
case 'W':
@ -94,7 +94,7 @@ DoOption(text)
}
}
}
else warning_classes = W_OLDFASHIONED|W_STRICT|W_ORDINARY;
else warning_classes = W_ALL;
break;
case 'M': { /* maximum identifier length */

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; }

View file

@ -20,10 +20,11 @@
#define W_ORDINARY 1
#define W_STRICT 2
#define W_OLDFASHIONED 4
#define W_ALWAYS 010 /* always given */
#define W_ALL (W_ORDINARY|W_STRICT|W_OLDFASHIONED)
#define W_ALL (W_ORDINARY|W_STRICT|W_OLDFASHIONED|W_ALWAYS)
#define W_INITIAL (W_ORDINARY | W_OLDFASHIONED)
#define W_INITIAL (W_ORDINARY | W_OLDFASHIONED | W_ALWAYS)
/* The bit mask itself: */
extern int warning_classes;