393 |
"internal error: previously-checked referenced subpattern not found\0" |
"internal error: previously-checked referenced subpattern not found\0" |
394 |
"DEFINE group contains more than one branch\0" |
"DEFINE group contains more than one branch\0" |
395 |
/* 55 */ |
/* 55 */ |
396 |
"repeating a DEFINE group is not allowed\0" |
"repeating a DEFINE group is not allowed\0" /** DEAD **/ |
397 |
"inconsistent NEWLINE options\0" |
"inconsistent NEWLINE options\0" |
398 |
"\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0" |
"\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0" |
399 |
"a numbered reference must not be zero\0" |
"a numbered reference must not be zero\0" |
4210 |
op_type = 0; /* Default single-char op codes */ |
op_type = 0; /* Default single-char op codes */ |
4211 |
possessive_quantifier = FALSE; /* Default not possessive quantifier */ |
possessive_quantifier = FALSE; /* Default not possessive quantifier */ |
4212 |
|
|
4213 |
/* Save start of previous item, in case we have to move it up to make space |
/* Save start of previous item, in case we have to move it up in order to |
4214 |
for an inserted OP_ONCE for the additional '+' extension. */ |
insert something before it. */ |
4215 |
|
|
4216 |
tempcode = previous; |
tempcode = previous; |
4217 |
|
|
4554 |
} |
} |
4555 |
|
|
4556 |
/* If previous was a bracket group, we may have to replicate it in certain |
/* If previous was a bracket group, we may have to replicate it in certain |
4557 |
cases. Note that at this point we can encounter only the "basic" BRA and |
cases. Note that at this point we can encounter only the "basic" bracket |
4558 |
KET opcodes, as this is the place where they get converted into the more |
opcodes such as BRA and CBRA, as this is the place where they get converted |
4559 |
special varieties. */ |
into the more special varieties such as BRAPOS and SBRA. A test for >= |
4560 |
|
OP_ASSERT and <= OP_COND includes ASSERT, ASSERT_NOT, ASSERTBACK, |
4561 |
|
ASSERTBACK_NOT, ONCE, BRA, CBRA, and COND. Originally, PCRE did not allow |
4562 |
|
repetition of assertions, but now it does, for Perl compatibility. */ |
4563 |
|
|
4564 |
else if (*previous == OP_BRA || *previous == OP_CBRA || |
else if (*previous >= OP_ASSERT && *previous <= OP_COND) |
|
*previous == OP_ONCE || *previous == OP_COND) |
|
4565 |
{ |
{ |
4566 |
register int i; |
register int i; |
4567 |
int len = (int)(code - previous); |
int len = (int)(code - previous); |
4568 |
uschar *bralink = NULL; |
uschar *bralink = NULL; |
4569 |
uschar *brazeroptr = NULL; |
uschar *brazeroptr = NULL; |
4570 |
|
|
4571 |
/* Repeating a DEFINE group is pointless */ |
/* Repeating a DEFINE group is pointless, but Perl allows the syntax, so |
4572 |
|
we just ignore the repeat. */ |
4573 |
|
|
4574 |
if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF) |
if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF) |
4575 |
{ |
goto END_REPEAT; |
4576 |
*errorcodeptr = ERR55; |
|
4577 |
goto FAILED; |
/* There is no sense in actually repeating assertions. The only potential |
4578 |
} |
use of repetition is in cases when the assertion is optional. Therefore, |
4579 |
|
if the minimum is greater than zero, just ignore the repeat. If the |
4580 |
|
maximum is not not zero or one, set it to 1. */ |
4581 |
|
|
4582 |
|
if (*previous < OP_ONCE) /* Assertion */ |
4583 |
|
{ |
4584 |
|
if (repeat_min > 0) goto END_REPEAT; |
4585 |
|
if (repeat_max < 0 || repeat_max > 1) repeat_max = 1; |
4586 |
|
} |
4587 |
|
|
4588 |
/* The case of a zero minimum is special because of the need to stick |
/* The case of a zero minimum is special because of the need to stick |
4589 |
OP_BRAZERO in front of it, and because the group appears once in the |
OP_BRAZERO in front of it, and because the group appears once in the |
4603 |
** goto END_REPEAT; |
** goto END_REPEAT; |
4604 |
** } |
** } |
4605 |
|
|
4606 |
However, that fails when a group is referenced as a subroutine from |
However, that fails when a group or a subgroup within it is referenced |
4607 |
elsewhere in the pattern, so now we stick in OP_SKIPZERO in front of it |
as a subroutine from elsewhere in the pattern, so now we stick in |
4608 |
so that it is skipped on execution. As we don't have a list of which |
OP_SKIPZERO in front of it so that it is skipped on execution. As we |
4609 |
groups are referenced, we cannot do this selectively. |
don't have a list of which groups are referenced, we cannot do this |
4610 |
|
selectively. |
4611 |
|
|
4612 |
If the maximum is 1 or unlimited, we just have to stick in the BRAZERO |
If the maximum is 1 or unlimited, we just have to stick in the BRAZERO |
4613 |
and do no more at this point. However, we do need to adjust any |
and do no more at this point. However, we do need to adjust any |
5872 |
skipbytes = 2; |
skipbytes = 2; |
5873 |
} |
} |
5874 |
|
|
5875 |
/* Process nested bracketed regex. Assertions may not be repeated, but |
/* Process nested bracketed regex. Assertions used not to be repeatable, |
5876 |
other kinds can be. All their opcodes are >= OP_ONCE. We copy code into a |
but this was changed for Perl compatibility, so all kinds can now be |
5877 |
non-register variable (tempcode) in order to be able to pass its address |
repeated. We copy code into a non-register variable (tempcode) in order to |
5878 |
because some compilers complain otherwise. */ |
be able to pass its address because some compilers complain otherwise. */ |
5879 |
|
|
5880 |
previous = (bravalue >= OP_ONCE)? code : NULL; |
previous = code; /* For handling repetition */ |
5881 |
*code = bravalue; |
*code = bravalue; |
5882 |
tempcode = code; |
tempcode = code; |
5883 |
tempreqvary = cd->req_varyopt; /* Save value before bracket */ |
tempreqvary = cd->req_varyopt; /* Save value before bracket */ |