some fixes
This commit is contained in:
parent
4623ed60b0
commit
16082b9056
4 changed files with 15 additions and 7 deletions
|
@ -30,7 +30,7 @@ IMPORT char *getwdir();
|
|||
PRIVATE char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */
|
||||
/* 1 if a corresponding ELSE has been */
|
||||
/* encountered. */
|
||||
PRIVATE int nestlevel = -1; /* initially no nesting level. */
|
||||
int nestlevel = -1; /* initially no nesting level. */
|
||||
|
||||
PRIVATE char *
|
||||
GetIdentifier()
|
||||
|
|
|
@ -36,7 +36,7 @@ error(fmt, args)
|
|||
warning(fmt, args)
|
||||
char *fmt;
|
||||
{
|
||||
err_hdr("warning ");
|
||||
err_hdr("(warning) ");
|
||||
doprnt(ERROUT, fmt, &args);
|
||||
fprint(ERROUT, "\n");
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ crash(fmt, args)
|
|||
char *fmt;
|
||||
int args;
|
||||
{
|
||||
err_hdr("crash ");
|
||||
err_hdr("CRASH\007 ");
|
||||
doprnt(ERROUT, fmt, &args);
|
||||
fprint(ERROUT, "\n");
|
||||
sys_stop(S_ABORT);
|
||||
|
@ -57,7 +57,7 @@ fatal(fmt, args)
|
|||
char *fmt;
|
||||
int args;
|
||||
{
|
||||
err_hdr("fatal ");
|
||||
err_hdr("fatal error -- ");
|
||||
doprnt(ERROUT, fmt, &args);
|
||||
fprint(ERROUT, "\n");
|
||||
sys_stop(S_EXIT);
|
||||
|
|
|
@ -40,13 +40,16 @@ int Unstacked;
|
|||
|
||||
AtEoIT()
|
||||
{
|
||||
if (NoUnstack) error("unexpected EOF");
|
||||
if (NoUnstack) warning("unexpected EOF");
|
||||
DoUnstack();
|
||||
return 0;
|
||||
}
|
||||
|
||||
AtEoIF()
|
||||
{
|
||||
if (NoUnstack) error("unexpected EOF");
|
||||
extern int nestlevel;
|
||||
|
||||
if (nestlevel != -1) warning("missing #endif");
|
||||
else if (NoUnstack) warning("unexpected EOF");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,11 @@ getactuals(idef)
|
|||
*/
|
||||
warning("argument mismatch, %s", idef->id_text);
|
||||
|
||||
while (++nr_of_params < acnt) {
|
||||
while (nr_of_params < acnt) {
|
||||
/* too few paraeters: remaining actuals are ""
|
||||
*/
|
||||
actparams[nr_of_params] = "";
|
||||
nr_of_params++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,16 +111,19 @@ copyact(ch1, ch2, level)
|
|||
|
||||
switch(ch) {
|
||||
|
||||
#ifdef __MATCHING_PAR__
|
||||
case ')':
|
||||
case '}':
|
||||
case ']':
|
||||
error("unbalanced parenthesis");
|
||||
break;
|
||||
#endif __MATCHING_PAR__
|
||||
|
||||
case '(':
|
||||
copyact('(', ')', level+1);
|
||||
break;
|
||||
|
||||
#ifdef __MATCHING_PAR__
|
||||
case '{':
|
||||
/* example:
|
||||
#define declare(v, t) t v
|
||||
|
@ -131,6 +135,7 @@ copyact(ch1, ch2, level)
|
|||
case '[':
|
||||
copyact('[', ']', level+1);
|
||||
break;
|
||||
#endif __MATCHING_PAR__
|
||||
|
||||
case '\n':
|
||||
LoadChar(ch);
|
||||
|
|
Loading…
Reference in a new issue