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

Diff for /src/usr.bin/mg/interpreter.c between version 1.31 and 1.32

version 1.31, 2021/05/08 12:57:41 version 1.32, 2021/05/12 11:13:23
Line 79 
Line 79 
 static int       foundfun(char *, int);  static int       foundfun(char *, int);
 static int       doregex(char *, char *);  static int       doregex(char *, char *);
 static void      clearexp(void);  static void      clearexp(void);
 static int       parse(char *, const char *, const char *, int, int, int);  static int       parse(char *, const char *, const char *, int, int, int, int);
 static int       parsdef(char *, const char *, const char *, int, int, int);  static int       parsdef(char *, const char *, const char *, int, int, int);
 static int       parsval(char *, const char *, const char *, int, int, int);  static int       parsval(char *, const char *, const char *, int, int, int);
 static int       parsexp(char *, const char *, const char *, int, int, int);  static int       parsexp(char *, const char *, const char *, int, int, int);
Line 128 
Line 128 
         char            *p, *begp = NULL, *endp = NULL, *prechr;          char            *p, *begp = NULL, *endp = NULL, *prechr;
         char            *lastchr = NULL;          char            *lastchr = NULL;
         int              i, ret, pctr, expctr, blkid, inquote, esc;          int              i, ret, pctr, expctr, blkid, inquote, esc;
         int              elen, spc;          int              elen, spc, ns;
   
         pctr = expctr = inquote = esc = elen = spc = 0;          pctr = expctr = inquote = esc = elen = spc = ns = 0;
         blkid = 1;          blkid = 1;
         lnm = lnum;          lnm = lnum;
   
Line 169 
Line 169 
                                     "left parantheses line", lnm));                                      "left parantheses line", lnm));
                         if (inquote == 0) {                          if (inquote == 0) {
                                 if (begp != NULL) {                                  if (begp != NULL) {
                                           if (*prechr == ' ')
                                                   ns--;
                                         if (endp == NULL)                                          if (endp == NULL)
                                                 *p = '\0';                                                  *p = '\0';
                                         else                                          else
                                                 *endp = '\0';                                                  *endp = '\0';
   
                                         ret = parse(begp, lrp, &lp, blkid,                                          ret = parse(begp, lrp, &lp, blkid,
                                             ++expctr, elen - spc);                                              ++expctr, elen - spc, ns);
                                         if (!ret) {                                          if (!ret) {
                                                 cleanup();                                                  cleanup();
                                                 return(ret);                                                  return(ret);
Line 197 
Line 199 
                                     "not supported line", lnm));                                      "not supported line", lnm));
                         if (inquote == 0) {                          if (inquote == 0) {
                                 if (begp != NULL) {                                  if (begp != NULL) {
                                           if (*prechr == ' ')
                                                   ns--;
                                         if (endp == NULL)                                          if (endp == NULL)
                                                 *p = '\0';                                                  *p = '\0';
                                         else                                          else
                                                 *endp = '\0';                                                  *endp = '\0';
   
                                         ret = parse(begp, lrp, &rp, blkid,                                          ret = parse(begp, lrp, &rp, blkid,
                                             ++expctr, elen - spc);                                              ++expctr, elen - spc, ns);
                                         if (!ret) {                                          if (!ret) {
                                                 cleanup();                                                  cleanup();
                                                 return(ret);                                                  return(ret);
Line 246 
Line 250 
                                 *p = ' ';                                  *p = ' ';
                                 endp = p;                                  endp = p;
                                 spc++;                                  spc++;
                                   if (begp != NULL)
                                           ns++;
                         }                          }
                         esc = 0;                          esc = 0;
                 } else if (*p == '\t' || *p == ' ') {                  } else if (*p == '\t' || *p == ' ') {
Line 282 
Line 288 
   
 static int  static int
 parse(char *begp, const char *par1, const char *par2, int blkid, int expctr,  parse(char *begp, const char *par1, const char *par2, int blkid, int expctr,
     int elen)      int elen, int ns)
 {  {
         char    *regs;          char    *regs;
         int      ret = FALSE;          int      ret = FALSE;

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32