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()
warning(fmt, args)
char *fmt;
{
- err_hdr("warning ");
+ err_hdr("(warning) ");
doprnt(ERROUT, fmt, &args);
fprint(ERROUT, "\n");
}
char *fmt;
int args;
{
- err_hdr("crash ");
+ err_hdr("CRASH\007 ");
doprnt(ERROUT, fmt, &args);
fprint(ERROUT, "\n");
sys_stop(S_ABORT);
char *fmt;
int args;
{
- err_hdr("fatal ");
+ err_hdr("fatal error -- ");
doprnt(ERROUT, fmt, &args);
fprint(ERROUT, "\n");
sys_stop(S_EXIT);
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;
}
*/
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++;
}
}
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
case '[':
copyact('[', ']', level+1);
break;
+#endif __MATCHING_PAR__
case '\n':
LoadChar(ch);