71 |
/* Special internal returns from the match() function. Make them sufficiently |
/* Special internal returns from the match() function. Make them sufficiently |
72 |
negative to avoid the external error codes. */ |
negative to avoid the external error codes. */ |
73 |
|
|
74 |
#define MATCH_COMMIT (-999) |
#define MATCH_ACCEPT (-999) |
75 |
#define MATCH_PRUNE (-998) |
#define MATCH_COMMIT (-998) |
76 |
#define MATCH_SKIP (-997) |
#define MATCH_PRUNE (-997) |
77 |
#define MATCH_SKIP_ARG (-996) |
#define MATCH_SKIP (-996) |
78 |
#define MATCH_THEN (-995) |
#define MATCH_SKIP_ARG (-995) |
79 |
|
#define MATCH_THEN (-994) |
80 |
|
|
81 |
/* This is a convenience macro for code that occurs many times. */ |
/* This is a convenience macro for code that occurs many times. */ |
82 |
|
|
1158 |
md->end_match_ptr = eptr; /* Record where we ended */ |
md->end_match_ptr = eptr; /* Record where we ended */ |
1159 |
md->end_offset_top = offset_top; /* and how many extracts were taken */ |
md->end_offset_top = offset_top; /* and how many extracts were taken */ |
1160 |
md->start_match_ptr = mstart; /* and the start (\K can modify) */ |
md->start_match_ptr = mstart; /* and the start (\K can modify) */ |
1161 |
MRRETURN(MATCH_MATCH); |
MRRETURN(((op == OP_END)? MATCH_MATCH : MATCH_ACCEPT)); |
1162 |
|
|
1163 |
/* Change option settings */ |
/* Change option settings */ |
1164 |
|
|
1180 |
{ |
{ |
1181 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
1182 |
RM4); |
RM4); |
1183 |
if (rrc == MATCH_MATCH) |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
1184 |
{ |
{ |
1185 |
mstart = md->start_match_ptr; /* In case \K reset it */ |
mstart = md->start_match_ptr; /* In case \K reset it */ |
1186 |
break; |
break; |
1213 |
{ |
{ |
1214 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
1215 |
RM5); |
RM5); |
1216 |
if (rrc == MATCH_MATCH) MRRETURN(MATCH_NOMATCH); |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) MRRETURN(MATCH_NOMATCH); |
1217 |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
1218 |
{ |
{ |
1219 |
do ecode += GET(ecode,1); while (*ecode == OP_ALT); |
do ecode += GET(ecode,1); while (*ecode == OP_ALT); |
1348 |
{ |
{ |
1349 |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
1350 |
md, ims, eptrb, flags, RM6); |
md, ims, eptrb, flags, RM6); |
1351 |
if (rrc == MATCH_MATCH) |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
1352 |
{ |
{ |
1353 |
DPRINTF(("Recursion matched\n")); |
DPRINTF(("Recursion matched\n")); |
1354 |
md->recursive = new_recursive.prevrec; |
md->recursive = new_recursive.prevrec; |
1394 |
do |
do |
1395 |
{ |
{ |
1396 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); |
1397 |
if (rrc == MATCH_MATCH) |
if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ |
1398 |
{ |
{ |
1399 |
mstart = md->start_match_ptr; |
mstart = md->start_match_ptr; |
1400 |
break; |
break; |
5824 |
|
|
5825 |
ENDLOOP: |
ENDLOOP: |
5826 |
|
|
5827 |
if (rc == MATCH_MATCH) |
if (rc == MATCH_MATCH || rc == MATCH_ACCEPT) |
5828 |
{ |
{ |
5829 |
if (using_temporary_offsets) |
if (using_temporary_offsets) |
5830 |
{ |
{ |