nestlevel count per file
This commit is contained in:
parent
7d2f8e4d3e
commit
b630da3424
4 changed files with 4 additions and 2 deletions
|
@ -30,7 +30,6 @@ IMPORT char *getwdir();
|
|||
PRIVATE char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */
|
||||
/* 1 if a corresponding ELSE has been */
|
||||
/* encountered. */
|
||||
int nestlevel = -1; /* initially no nesting level. */
|
||||
|
||||
PRIVATE char *
|
||||
GetIdentifier()
|
||||
|
@ -263,6 +262,7 @@ do_include()
|
|||
}
|
||||
else {
|
||||
WorkingDir = getwdir(result);
|
||||
nestlevel = -1;
|
||||
FileName = result;
|
||||
LineNumber = 1;
|
||||
}
|
||||
|
|
|
@ -9,10 +9,12 @@ struct file_info {
|
|||
unsigned int fil_lino;
|
||||
char *fil_name;
|
||||
char *fil_wdir;
|
||||
int fil_nestlevel;
|
||||
};
|
||||
|
||||
#define LineNumber finfo.fil_lino
|
||||
#define FileName finfo.fil_name
|
||||
#define WorkingDir finfo.fil_wdir
|
||||
#define nestlevel finfo.fil_nestlevel
|
||||
|
||||
extern struct file_info finfo; /* input.c */
|
||||
|
|
|
@ -47,7 +47,6 @@ AtEoIT()
|
|||
|
||||
AtEoIF()
|
||||
{
|
||||
extern int nestlevel;
|
||||
|
||||
if (nestlevel != -1) warning("missing #endif");
|
||||
else if (NoUnstack) warning("unexpected EOF");
|
||||
|
|
|
@ -77,5 +77,6 @@ compile(argc, argv)
|
|||
fatal("%s: no source file %s\n", prog_name,
|
||||
source ? source : "stdin");
|
||||
if (source) WorkingDir = getwdir(dummy);
|
||||
nestlevel = -1;
|
||||
preprocess(source);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue