some fixes
authorceriel <none@none>
Fri, 7 Aug 1987 19:54:45 +0000 (19:54 +0000)
committerceriel <none@none>
Fri, 7 Aug 1987 19:54:45 +0000 (19:54 +0000)
util/cpp/domacro.c
util/cpp/error.c
util/cpp/input.c
util/cpp/scan.c

index 344d46d..6ef927a 100644 (file)
@@ -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()
index f2daa9e..8bafd6b 100644 (file)
@@ -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);
index e280031..0e78ca0 100644 (file)
@@ -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;
 }
index bf92a14..e996024 100644 (file)
@@ -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);