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); |
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) |
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: |
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: |
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: |
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: |
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: |
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: |
2080 |
< -1 => some kind of unexpected problem |
< -1 => some kind of unexpected problem |
2081 |
*/ |
*/ |
2082 |
|
|
2083 |
PCRE_DATA_SCOPE int |
PCRE_EXP_DEFN int |
2084 |
pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, |
2085 |
const char *subject, int length, int start_offset, int options, int *offsets, |
const char *subject, int length, int start_offset, int options, int *offsets, |
2086 |
int offsetcount, int *workspace, int wscount) |
int offsetcount, int *workspace, int wscount) |
2173 |
/* Handle different types of newline. The three bits give eight cases. If |
/* Handle different types of newline. The three bits give eight cases. If |
2174 |
nothing is set at run time, whatever was used at compile time applies. */ |
nothing is set at run time, whatever was used at compile time applies. */ |
2175 |
|
|
2176 |
switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : options) & |
switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : (pcre_uint32)options) & |
2177 |
PCRE_NEWLINE_BITS) |
PCRE_NEWLINE_BITS) |
2178 |
{ |
{ |
2179 |
case 0: newline = NEWLINE; break; /* Compile-time default */ |
case 0: newline = NEWLINE; break; /* Compile-time default */ |
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 |
} |
} |
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++; |
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++; |