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

Diff for /src/usr.bin/awk/lex.c between version 1.15 and 1.16

version 1.15, 2020/06/10 21:03:36 version 1.16, 2020/06/10 21:03:56
Line 175 
Line 175 
 int     word(char *);  int     word(char *);
 int     string(void);  int     string(void);
 int     regexpr(void);  int     regexpr(void);
 int     sc      = 0;    /* 1 => return a } right now */  bool    sc      = false;        /* true => return a } right now */
 int     reg     = 0;    /* 1 => return a REGEXPR now */  bool    reg     = false;        /* true => return a REGEXPR now */
   
 int yylex(void)  int yylex(void)
 {  {
Line 187 
Line 187 
         if (buf == NULL && (buf = malloc(bufsize)) == NULL)          if (buf == NULL && (buf = malloc(bufsize)) == NULL)
                 FATAL( "out of space in yylex" );                  FATAL( "out of space in yylex" );
         if (sc) {          if (sc) {
                 sc = 0;                  sc = false;
                 RET('}');                  RET('}');
         }          }
         if (reg) {          if (reg) {
                 reg = 0;                  reg = false;
                 return regexpr();                  return regexpr();
         }          }
         for (;;) {          for (;;) {
Line 338 
Line 338 
                 case '}':                  case '}':
                         if (--bracecnt < 0)                          if (--bracecnt < 0)
                                 SYNTAX( "extra }" );                                  SYNTAX( "extra }" );
                         sc = 1;                          sc = true;
                         RET(';');                          RET(';');
                 case ']':                  case ']':
                         if (--brackcnt < 0)                          if (--brackcnt < 0)
Line 511 
Line 511 
   
 void startreg(void)     /* next call to yylex will return a regular expression */  void startreg(void)     /* next call to yylex will return a regular expression */
 {  {
         reg = 1;          reg = true;
 }  }
   
 int regexpr(void)  int regexpr(void)

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16