Tidy ACROSSCHAR macro to take same form as FORWARDCHAR and BACKCHAR.
This commit is contained in:
parent
4048606896
commit
85f8ecba58
|
@ -508,7 +508,8 @@ if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
|
|||
{
|
||||
if (current_subject <= start_subject) break;
|
||||
current_subject--;
|
||||
ACROSSCHAR(current_subject > start_subject, *current_subject, current_subject--);
|
||||
ACROSSCHAR(current_subject > start_subject, current_subject,
|
||||
current_subject--);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3380,7 +3381,7 @@ for (;;)
|
|||
while (t < end_subject && !IS_NEWLINE(t))
|
||||
{
|
||||
t++;
|
||||
ACROSSCHAR(t < end_subject, *t, t++);
|
||||
ACROSSCHAR(t < end_subject, t, t++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3485,8 +3486,7 @@ for (;;)
|
|||
while (start_match < end_subject && !WAS_NEWLINE(start_match))
|
||||
{
|
||||
start_match++;
|
||||
ACROSSCHAR(start_match < end_subject, *start_match,
|
||||
start_match++);
|
||||
ACROSSCHAR(start_match < end_subject, start_match, start_match++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3648,8 +3648,7 @@ for (;;)
|
|||
#ifdef SUPPORT_UNICODE
|
||||
if (utf)
|
||||
{
|
||||
ACROSSCHAR(start_match < end_subject, *start_match,
|
||||
start_match++);
|
||||
ACROSSCHAR(start_match < end_subject, start_match, start_match++);
|
||||
}
|
||||
#endif
|
||||
if (start_match > end_subject) break;
|
||||
|
|
|
@ -351,7 +351,7 @@ because almost all calls are already within a block of UTF-8 only code. */
|
|||
|
||||
/* Same as above, but it allows a fully customizable form. */
|
||||
#define ACROSSCHAR(condition, eptr, action) \
|
||||
while((condition) && ((eptr) & 0xc0u) == 0x80u) action
|
||||
while((condition) && ((*eptr) & 0xc0u) == 0x80u) action
|
||||
|
||||
/* Deposit a character into memory, returning the number of code units. */
|
||||
|
||||
|
@ -457,7 +457,7 @@ code. */
|
|||
|
||||
/* Same as above, but it allows a fully customizable form. */
|
||||
#define ACROSSCHAR(condition, eptr, action) \
|
||||
if ((condition) && ((eptr) & 0xfc00u) == 0xdc00u) action
|
||||
if ((condition) && ((*eptr) & 0xfc00u) == 0xdc00u) action
|
||||
|
||||
/* Deposit a character into memory, returning the number of code units. */
|
||||
|
||||
|
|
|
@ -879,7 +879,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
}
|
||||
Feptr++;
|
||||
#ifdef SUPPORT_UNICODE
|
||||
if (utf) ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
if (utf) ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
#endif
|
||||
Fecode++;
|
||||
break;
|
||||
|
@ -2776,7 +2776,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
|
||||
}
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2789,7 +2789,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2943,7 +2943,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
if (cc < 128 && (mb->ctypes[cc] & ctype_space) != 0)
|
||||
RRETURN(MATCH_NOMATCH);
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2977,7 +2977,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
if (cc < 128 && (mb->ctypes[cc] & ctype_word) != 0)
|
||||
RRETURN(MATCH_NOMATCH);
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -4110,7 +4110,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
|
||||
}
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -4125,7 +4125,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
|||
break;
|
||||
}
|
||||
Feptr++;
|
||||
ACROSSCHAR(Feptr < mb->end_subject, *Feptr, Feptr++);
|
||||
ACROSSCHAR(Feptr < mb->end_subject, Feptr, Feptr++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -6378,7 +6378,7 @@ for(;;)
|
|||
while (t < end_subject && !IS_NEWLINE(t))
|
||||
{
|
||||
t++;
|
||||
ACROSSCHAR(t < end_subject, *t, t++);
|
||||
ACROSSCHAR(t < end_subject, t, t++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -6489,8 +6489,7 @@ for(;;)
|
|||
while (start_match < end_subject && !WAS_NEWLINE(start_match))
|
||||
{
|
||||
start_match++;
|
||||
ACROSSCHAR(start_match < end_subject, *start_match,
|
||||
start_match++);
|
||||
ACROSSCHAR(start_match < end_subject, start_match, start_match++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -6709,7 +6708,7 @@ for(;;)
|
|||
new_start_match = start_match + 1;
|
||||
#ifdef SUPPORT_UNICODE
|
||||
if (utf)
|
||||
ACROSSCHAR(new_start_match < end_subject, *new_start_match,
|
||||
ACROSSCHAR(new_start_match < end_subject, new_start_match,
|
||||
new_start_match++);
|
||||
#endif
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue