[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.24 and 1.25

version 1.24, 2021/05/03 13:28:03 version 1.25, 2021/05/05 06:12:23
Line 37 
Line 37 
  * 3. conditional execution.   * 3. conditional execution.
  * 4. have memory allocated dynamically for variable values.   * 4. have memory allocated dynamically for variable values.
  * 5. do symbol names need more complex regex patterns? [A-Za-z][.0-9_A-Z+a-z-]   * 5. do symbol names need more complex regex patterns? [A-Za-z][.0-9_A-Z+a-z-]
  *    at the moment.   *    at the moment.
  * 6. oh so many things....   * 6. display line numbers with parsing errors.
    * 7. oh so many things....
  * [...]   * [...]
  * n. implement user definable functions.   * n. implement user definable functions.
  *   *
Line 120 
Line 121 
 foundparen(char *funstr, int llen)  foundparen(char *funstr, int llen)
 {  {
         const char      *lrp = NULL;          const char      *lrp = NULL;
         char            *p, *begp = NULL, *endp = NULL, *regs;          char            *p, *begp = NULL, *endp = NULL, *regs, *prechr;
         int              i, ret, pctr, expctr, blkid, inquote, esc;          int              i, ret, pctr, expctr, blkid, inquote, esc;
   
         pctr = expctr = inquote = esc = 0;          pctr = expctr = inquote = esc = 0;
Line 209 
Line 210 
                         if (begp == NULL)                          if (begp == NULL)
                                 begp = p;                                  begp = p;
                         if (*p == '"') {                          if (*p == '"') {
                                 if (inquote == 0 && esc == 0)                                  if (inquote == 0 && esc == 0) {
                                           if (*prechr != ' ' && *prechr != '\t')
                                                   return(dobeep_msg("char err"));
                                         inquote++;                                          inquote++;
                                 else if (inquote > 0 && esc == 1)                                  } else if (inquote > 0 && esc == 1)
                                         esc = 0;                                          esc = 0;
                                 else                                  else
                                         inquote--;                                          inquote--;
                           } else if (*prechr == '"' && inquote == 0) {
                                   return(dobeep_msg("char err"));
                         }                          }
                         endp = NULL;                          endp = NULL;
                 } else if (endp == NULL && (*p == ' ' || *p == '\t')) {                  } else if (endp == NULL && (*p == ' ' || *p == '\t')) {
Line 232 
Line 237 
                         expctr = 0;                          expctr = 0;
                         defnam = NULL;                          defnam = NULL;
                 }                  }
                   prechr = p;
         }          }
   
         if (pctr != 0) {          if (pctr != 0) {

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