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

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 145 by ph10, Wed Apr 4 14:06:52 2007 UTC revision 152 by ph10, Tue Apr 17 15:55:53 2007 UTC
# Line 500  for (;;) Line 500  for (;;)
500      const uschar *code;      const uschar *code;
501      int state_offset = current_state->offset;      int state_offset = current_state->offset;
502      int count, codevalue;      int count, codevalue;
503    #ifdef SUPPORT_UCP
504      int chartype, script;      int chartype, script;
505    #endif
506    
507  #ifdef DEBUG  #ifdef DEBUG
508      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);
# Line 783  for (;;) Line 785  for (;;)
785        break;        break;
786    
787    
 #ifdef SUPPORT_UCP  
   
788        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
789        /* Check the next character by Unicode property. We will get here only        /* Check the next character by Unicode property. We will get here only
790        if the support is in the binary; otherwise a compile-time error occurs.        if the support is in the binary; otherwise a compile-time error occurs.
791        */        */
792    
793    #ifdef SUPPORT_UCP
794        case OP_PROP:        case OP_PROP:
795        case OP_NOTPROP:        case OP_NOTPROP:
796        if (clen > 0)        if (clen > 0)
# Line 970  for (;;) Line 971  for (;;)
971        argument. It keeps the code above fast for the other cases. The argument        argument. It keeps the code above fast for the other cases. The argument
972        is in the d variable. */        is in the d variable. */
973    
974    #ifdef SUPPORT_UCP
975        case OP_PROP_EXTRA + OP_TYPEPLUS:        case OP_PROP_EXTRA + OP_TYPEPLUS:
976        case OP_PROP_EXTRA + OP_TYPEMINPLUS:        case OP_PROP_EXTRA + OP_TYPEMINPLUS:
977        case OP_PROP_EXTRA + OP_TYPEPOSPLUS:        case OP_PROP_EXTRA + OP_TYPEPOSPLUS:
# Line 1049  for (;;) Line 1051  for (;;)
1051          ADD_NEW_DATA(-state_offset, count, ncount);          ADD_NEW_DATA(-state_offset, count, ncount);
1052          }          }
1053        break;        break;
1054    #endif
1055    
1056        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1057        case OP_ANYNL_EXTRA + OP_TYPEPLUS:        case OP_ANYNL_EXTRA + OP_TYPEPLUS:
# Line 1085  for (;;) Line 1088  for (;;)
1088        break;        break;
1089    
1090        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1091    #ifdef SUPPORT_UCP
1092        case OP_PROP_EXTRA + OP_TYPEQUERY:        case OP_PROP_EXTRA + OP_TYPEQUERY:
1093        case OP_PROP_EXTRA + OP_TYPEMINQUERY:        case OP_PROP_EXTRA + OP_TYPEMINQUERY:
1094        case OP_PROP_EXTRA + OP_TYPEPOSQUERY:        case OP_PROP_EXTRA + OP_TYPEPOSQUERY:
# Line 1182  for (;;) Line 1186  for (;;)
1186          ADD_NEW_DATA(-(state_offset + count), 0, ncount);          ADD_NEW_DATA(-(state_offset + count), 0, ncount);
1187          }          }
1188        break;        break;
1189    #endif
1190    
1191        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1192        case OP_ANYNL_EXTRA + OP_TYPEQUERY:        case OP_ANYNL_EXTRA + OP_TYPEQUERY:
# Line 1226  for (;;) Line 1231  for (;;)
1231        break;        break;
1232    
1233        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1234    #ifdef SUPPORT_UCP
1235        case OP_PROP_EXTRA + OP_TYPEEXACT:        case OP_PROP_EXTRA + OP_TYPEEXACT:
1236        case OP_PROP_EXTRA + OP_TYPEUPTO:        case OP_PROP_EXTRA + OP_TYPEUPTO:
1237        case OP_PROP_EXTRA + OP_TYPEMINUPTO:        case OP_PROP_EXTRA + OP_TYPEMINUPTO:
# Line 1313  for (;;) Line 1319  for (;;)
1319            { ADD_NEW_DATA(-state_offset, count, ncount); }            { ADD_NEW_DATA(-state_offset, count, ncount); }
1320          }          }
1321        break;        break;
1322    #endif
1323    
1324        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1325        case OP_ANYNL_EXTRA + OP_TYPEEXACT:        case OP_ANYNL_EXTRA + OP_TYPEEXACT:
# Line 2175  switch ((((options & PCRE_NEWLINE_BITS) Line 2182  switch ((((options & PCRE_NEWLINE_BITS)
2182    case PCRE_NEWLINE_CR+    case PCRE_NEWLINE_CR+
2183         PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;         PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;
2184    case PCRE_NEWLINE_ANY: newline = -1; break;    case PCRE_NEWLINE_ANY: newline = -1; break;
2185      case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
2186    default: return PCRE_ERROR_BADNEWLINE;    default: return PCRE_ERROR_BADNEWLINE;
2187    }    }
2188    
2189  if (newline < 0)  if (newline == -2)
2190      {
2191      md->nltype = NLTYPE_ANYCRLF;
2192      }
2193    else if (newline < 0)
2194    {    {
2195    md->nltype = NLTYPE_ANY;    md->nltype = NLTYPE_ANY;
2196    }    }
# Line 2309  for (;;) Line 2321  for (;;)
2321          while (current_subject <= end_subject && !WAS_NEWLINE(current_subject))          while (current_subject <= end_subject && !WAS_NEWLINE(current_subject))
2322            current_subject++;            current_subject++;
2323    
2324          /* If we have just passed a CR and the newline option is ANY, and we          /* If we have just passed a CR and the newline option is ANY or
2325          are now at a LF, advance the match position by one more character. */          ANYCRLF, and we are now at a LF, advance the match position by one more
2326            character. */
2327    
2328          if (current_subject[-1] == '\r' &&          if (current_subject[-1] == '\r' &&
2329               md->nltype == NLTYPE_ANY &&               (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
2330               current_subject < end_subject &&               current_subject < end_subject &&
2331               *current_subject == '\n')               *current_subject == '\n')
2332            current_subject++;            current_subject++;
# Line 2425  for (;;) Line 2438  for (;;)
2438      }      }
2439    if (current_subject > end_subject) break;    if (current_subject > end_subject) break;
2440    
2441    /* If we have just passed a CR and the newline option is CRLF or ANY, and we    /* If we have just passed a CR and the newline option is CRLF or ANY or
2442    are now at a LF, advance the match position by one more character. */    ANYCRLF, and we are now at a LF, advance the match position by one more
2443      character. */
2444    
2445    if (current_subject[-1] == '\r' &&    if (current_subject[-1] == '\r' &&
2446         (md->nltype == NLTYPE_ANY || md->nllen == 2) &&         (md->nltype == NLTYPE_ANY ||
2447            md->nltype == NLTYPE_ANYCRLF ||
2448            md->nllen == 2) &&
2449         current_subject < end_subject &&         current_subject < end_subject &&
2450         *current_subject == '\n')         *current_subject == '\n')
2451      current_subject++;      current_subject++;

Legend:
Removed from v.145  
changed lines
  Added in v.152

  ViewVC Help
Powered by ViewVC 1.1.5