[BACK]Return to main.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / m4

Diff for /src/usr.bin/m4/main.c between version 1.23 and 1.24

version 1.23, 2000/01/05 16:06:14 version 1.24, 2000/01/11 14:06:11
Line 93 
Line 93 
         { "sinclude",     SINCTYPE },          { "sinclude",     SINCTYPE },
         { "define",       DEFITYPE },          { "define",       DEFITYPE },
         { "defn",         DEFNTYPE },          { "defn",         DEFNTYPE },
         { "divert",       DIVRTYPE },          { "divert",       DIVRTYPE | NOARGS },
         { "expr",         EXPRTYPE },          { "expr",         EXPRTYPE },
         { "eval",         EXPRTYPE },          { "eval",         EXPRTYPE },
         { "substr",       SUBSTYPE },          { "substr",       SUBSTYPE },
Line 102 
Line 102 
         { "len",          LENGTYPE },          { "len",          LENGTYPE },
         { "incr",         INCRTYPE },          { "incr",         INCRTYPE },
         { "decr",         DECRTYPE },          { "decr",         DECRTYPE },
         { "dnl",          DNLNTYPE },          { "dnl",          DNLNTYPE | NOARGS },
         { "changequote",  CHNQTYPE },          { "changequote",  CHNQTYPE | NOARGS },
         { "changecom",    CHNCTYPE },          { "changecom",    CHNCTYPE | NOARGS },
         { "index",        INDXTYPE },          { "index",        INDXTYPE },
 #ifdef EXTENDED  #ifdef EXTENDED
         { "paste",        PASTTYPE },          { "paste",        PASTTYPE },
Line 112 
Line 112 
 #endif  #endif
         { "popdef",       POPDTYPE },          { "popdef",       POPDTYPE },
         { "pushdef",      PUSDTYPE },          { "pushdef",      PUSDTYPE },
         { "dumpdef",      DUMPTYPE },          { "dumpdef",      DUMPTYPE | NOARGS },
         { "shift",        SHIFTYPE },          { "shift",        SHIFTYPE | NOARGS },
         { "translit",     TRNLTYPE },          { "translit",     TRNLTYPE },
         { "undefine",     UNDFTYPE },          { "undefine",     UNDFTYPE },
         { "undivert",     UNDVTYPE },          { "undivert",     UNDVTYPE | NOARGS },
         { "divnum",       DIVNTYPE },          { "divnum",       DIVNTYPE | NOARGS },
         { "maketemp",     MKTMTYPE },          { "maketemp",     MKTMTYPE },
         { "errprint",     ERRPTYPE },          { "errprint",     ERRPTYPE | NOARGS },
         { "m4wrap",       M4WRTYPE },          { "m4wrap",       M4WRTYPE | NOARGS },
         { "m4exit",       EXITTYPE },          { "m4exit",       EXITTYPE | NOARGS },
         { "syscmd",       SYSCTYPE },          { "syscmd",       SYSCTYPE },
         { "sysval",       SYSVTYPE },          { "sysval",       SYSVTYPE | NOARGS },
   
 #if defined(unix) || defined(__unix__)  #if defined(unix) || defined(__unix__)
         { "unix",         SELFTYPE },          { "unix",         SELFTYPE | NOARGS },
 #else  #else
 #ifdef vms  #ifdef vms
         { "vms",          SELFTYPE },          { "vms",          SELFTYPE | NOARGS },
 #endif  #endif
 #endif  #endif
 };  };
Line 278 
Line 278 
                 if (t == '_' || isalpha(t)) {                  if (t == '_' || isalpha(t)) {
                         putback(t);                          putback(t);
                         s = token;                          s = token;
                         if ((p = inspect(s)) == nil) {                          p = inspect(s);
                                 if (sp < 0)                          if (p != nil)
                                         while (*s)                                  putback(l = gpbc());
                                                 putc(*s++, active);                          if (p == nil || (l != LPAREN &&
                                 else                              (p->type & NEEDARGS) != 0))
                                         while (*s)                                  outputstr(s);
                                                 chrsave(*s++);  
                         }  
                         else {                          else {
                 /*                  /*
                  * real thing.. First build a call frame:                   * real thing.. First build a call frame:
Line 301 
Line 299 
                                 pushs(p->name);       /* macro name  */                                  pushs(p->name);       /* macro name  */
                                 pushs(ep);            /* start next..*/                                  pushs(ep);            /* start next..*/
   
                                 putback(l = gpbc());  
                                 if (l != LPAREN)  {   /* add bracks  */                                  if (l != LPAREN)  {   /* add bracks  */
                                         putback(RPAREN);                                          putback(RPAREN);
                                         putback(LPAREN);                                          putback(LPAREN);
Line 343 
Line 340 
                                         chars[1] = EOS;                                          chars[1] = EOS;
                                         s = chars;                                          s = chars;
                                 }                                  }
                                 if (nlpar > 0) {                                  if (nlpar > 0)
                                         if (sp < 0)                                          outputstr(s);
                                                 while (*s)  
                                                         putc(*s++, active);  
                                         else  
                                                 while (*s)  
                                                         chrsave(*s++);  
                                 }  
                         }                          }
                         while (nlpar != 0);                          while (nlpar != 0);
                 }                  }
Line 439 
Line 430 
         }          }
 }  }
   
   /*
    * output string directly, without pushing it for reparses.
    */
   void
   outputstr(s)
           const char *s;
   {
           if (sp < 0)
                   while (*s)
                           putc(*s++, active);
           else
                   while (*s)
                           chrsave(*s++);
   }
   
 /*  /*
  * build an input token..   * build an input token..
  * consider only those starting with _ or A-Za-z. This is a   * consider only those starting with _ or A-Za-z. This is a
Line 490 
Line 496 
                 p->name = keywrds[i].knam;                  p->name = keywrds[i].knam;
                 p->defn = null;                  p->defn = null;
                 p->hv = h;                  p->hv = h;
                 p->type = keywrds[i].ktyp | STATIC;                  p->type = (keywrds[i].ktyp & TYPEMASK) | STATIC;
                   if ((keywrds[i].ktyp & NOARGS) == 0)
                           p->type |= NEEDARGS;
         }          }
 }  }
   

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24