/[pcre]/code/trunk/pcre_compile.c
ViewVC logotype

Diff of /code/trunk/pcre_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1253 by ph10, Fri Feb 22 11:38:35 2013 UTC revision 1266 by ph10, Sun Mar 3 11:14:26 2013 UTC
# Line 5729  for (;; ptr++) Line 5729  for (;; ptr++)
5729          /* ------------------------------------------------------------ */          /* ------------------------------------------------------------ */
5730          case CHAR_LEFT_PARENTHESIS:          case CHAR_LEFT_PARENTHESIS:
5731          bravalue = OP_COND;       /* Conditional group */          bravalue = OP_COND;       /* Conditional group */
5732            tempptr = ptr;
5733    
5734          /* A condition can be an assertion, a number (referring to a numbered          /* A condition can be an assertion, a number (referring to a numbered
5735          group), a name (referring to a named group), or 'R', referring to          group), a name (referring to a named group), or 'R', referring to
# Line 5741  for (;; ptr++) Line 5742  for (;; ptr++)
5742          be the recursive thing or the name 'R' (and similarly for 'R' followed          be the recursive thing or the name 'R' (and similarly for 'R' followed
5743          by digits), and (b) a number could be a name that consists of digits.          by digits), and (b) a number could be a name that consists of digits.
5744          In both cases, we look for a name first; if not found, we try the other          In both cases, we look for a name first; if not found, we try the other
5745          cases. */          cases.
5746    
5747            For compatibility with auto-callouts, we allow a callout to be
5748            specified before a condition that is an assertion. First, check for the
5749            syntax of a callout; if found, adjust the temporary pointer that is
5750            used to check for an assertion condition. That's all that is needed! */
5751    
5752            if (ptr[1] == CHAR_QUESTION_MARK && ptr[2] == CHAR_C)
5753              {
5754              for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break;
5755              if (ptr[i] == CHAR_RIGHT_PARENTHESIS)
5756                tempptr += i + 1;
5757              }
5758    
5759          /* For conditions that are assertions, check the syntax, and then exit          /* For conditions that are assertions, check the syntax, and then exit
5760          the switch. This will take control down to where bracketed groups,          the switch. This will take control down to where bracketed groups,
5761          including assertions, are processed. */          including assertions, are processed. */
5762    
5763          if (ptr[1] == CHAR_QUESTION_MARK && (ptr[2] == CHAR_EQUALS_SIGN ||          if (tempptr[1] == CHAR_QUESTION_MARK &&
5764              ptr[2] == CHAR_EXCLAMATION_MARK || ptr[2] == CHAR_LESS_THAN_SIGN))                (tempptr[2] == CHAR_EQUALS_SIGN ||
5765                   tempptr[2] == CHAR_EXCLAMATION_MARK ||
5766                   tempptr[2] == CHAR_LESS_THAN_SIGN))
5767            break;            break;
5768    
5769          /* Most other conditions use OP_CREF (a couple change to OP_RREF          /* Most other conditions use OP_CREF (a couple change to OP_RREF

Legend:
Removed from v.1253  
changed lines
  Added in v.1266

  ViewVC Help
Powered by ViewVC 1.1.5