/[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 488 by ph10, Mon Jan 11 15:29:42 2010 UTC revision 500 by ph10, Sat Mar 6 19:00:29 2010 UTC
# Line 263  the number of relocations needed when a Line 263  the number of relocations needed when a
263  it is now one long string. We cannot use a table of offsets, because the  it is now one long string. We cannot use a table of offsets, because the
264  lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead, we  lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead, we
265  simply count through to the one we want - this isn't a performance issue  simply count through to the one we want - this isn't a performance issue
266  because these strings are used only when there is a compilation error. */  because these strings are used only when there is a compilation error.
267    
268    Each substring ends with \0 to insert a null character. This includes the final
269    substring, so that the whole string ends with \0\0, which can be detected when
270    counting through. */
271    
272  static const char error_texts[] =  static const char error_texts[] =
273    "no error\0"    "no error\0"
# Line 344  static const char error_texts[] = Line 348  static const char error_texts[] =
348    "digit expected after (?+\0"    "digit expected after (?+\0"
349    "] is an invalid data character in JavaScript compatibility mode\0"    "] is an invalid data character in JavaScript compatibility mode\0"
350    /* 65 */    /* 65 */
351    "different names for subpatterns of the same number are not allowed";    "different names for subpatterns of the same number are not allowed\0";
   
352    
353  /* Table to identify digits and hex digits. This is used when compiling  /* Table to identify digits and hex digits. This is used when compiling
354  patterns. Note that the tables in chartables are dependent on the locale, and  patterns. Note that the tables in chartables are dependent on the locale, and
# Line 503  static const char * Line 506  static const char *
506  find_error_text(int n)  find_error_text(int n)
507  {  {
508  const char *s = error_texts;  const char *s = error_texts;
509  for (; n > 0; n--) while (*s++ != 0) {};  for (; n > 0; n--)
510      {
511      while (*s++ != 0) {};
512      if (*s == 0) return "Error text not found (please report)";
513      }
514  return s;  return s;
515  }  }
516    
# Line 1443  for (;;) Line 1450  for (;;)
1450      case OP_CALLOUT:      case OP_CALLOUT:
1451      case OP_SOD:      case OP_SOD:
1452      case OP_SOM:      case OP_SOM:
1453        case OP_SET_SOM:
1454      case OP_EOD:      case OP_EOD:
1455      case OP_EODN:      case OP_EODN:
1456      case OP_CIRC:      case OP_CIRC:
# Line 4430  we set the flag only if there is a liter Line 4438  we set the flag only if there is a liter
4438          case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break;          case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break;
4439          case OP_NOTUPTO:  *tempcode = OP_NOTPOSUPTO; break;          case OP_NOTUPTO:  *tempcode = OP_NOTPOSUPTO; break;
4440    
4441            /* Because we are moving code along, we must ensure that any
4442            pending recursive references are updated. */
4443    
4444          default:          default:
4445            *code = OP_END;
4446            adjust_recurse(tempcode, 1 + LINK_SIZE, utf8, cd, save_hwm);
4447          memmove(tempcode + 1+LINK_SIZE, tempcode, len);          memmove(tempcode + 1+LINK_SIZE, tempcode, len);
4448          code += 1 + LINK_SIZE;          code += 1 + LINK_SIZE;
4449          len += 1 + LINK_SIZE;          len += 1 + LINK_SIZE;
# Line 5149  we set the flag only if there is a liter Line 5162  we set the flag only if there is a liter
5162                  *errorcodeptr = ERR15;                  *errorcodeptr = ERR15;
5163                  goto FAILED;                  goto FAILED;
5164                  }                  }
5165    
5166                  /* Fudge the value of "called" so that when it is inserted as an
5167                  offset below, what it actually inserted is the reference number
5168                  of the group. */
5169    
5170                called = cd->start_code + recno;                called = cd->start_code + recno;
5171                PUTINC(cd->hwm, 0, code + 2 + LINK_SIZE - cd->start_code);                PUTINC(cd->hwm, 0, code + 2 + LINK_SIZE - cd->start_code);
5172                }                }
# Line 6804  if (reqbyte >= 0 && Line 6822  if (reqbyte >= 0 &&
6822  case when building a production library. */  case when building a production library. */
6823    
6824  #ifdef PCRE_DEBUG  #ifdef PCRE_DEBUG
   
6825  printf("Length = %d top_bracket = %d top_backref = %d\n",  printf("Length = %d top_bracket = %d top_backref = %d\n",
6826    length, re->top_bracket, re->top_backref);    length, re->top_bracket, re->top_backref);
6827    

Legend:
Removed from v.488  
changed lines
  Added in v.500

  ViewVC Help
Powered by ViewVC 1.1.5