summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-11-14 13:55:38 -0700
committerKarl Williamson <khw@cpan.org>2020-12-19 21:36:46 -0700
commitfbd8d54d31dadf460479192f11f6569ab3d10dd3 (patch)
tree1cbd99fcac906d2d4448b362922036efbc02f80d /regexec.c
parentbb3825626ed2b1217a2ac184eff66d0d4ed6e070 (diff)
downloadperl-fbd8d54d31dadf460479192f11f6569ab3d10dd3.tar.gz
regexec.c: White-space, comments only
Mostly indent because the prior commit created a new block
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c98
1 files changed, 50 insertions, 48 deletions
diff --git a/regexec.c b/regexec.c
index 533c0df503..597b49283f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1412,7 +1412,7 @@ Perl_re_intuit_start(pTHX_
* On the one hand you'd expect rare substrings to appear less
* often than \n's. On the other hand, searching for \n means
* we're effectively flipping between check_substr and "\n" on each
- * iteration as the current "rarest" string candidate, which
+ * iteration as the current "rarest" candidate string, which
* means for example that we'll quickly reject the whole string if
* hasn't got a \n, rather than trying every substr position
* first
@@ -4808,7 +4808,8 @@ S_setup_EXACTISH_ST(pTHX_ const regnode * const text_node,
fold_from = remaining_fold_froms[i-1];
}
- if (folded == fold_from) { /* We already added the character itself */
+ if (folded == fold_from) { /* We already added the character
+ itself */
continue;
}
@@ -4987,6 +4988,7 @@ S_setup_EXACTISH_ST(pTHX_ const regnode * const text_node,
m->lengths[output_index] = lengths[index_of_longest];
}
+
return TRUE;
}
@@ -9218,60 +9220,60 @@ NULL
curly_try_B_min_known:
/* find the next place where 'B' could work, then call B */
if (locinput + ST.Binfo.initial_exact < loceol) {
- if (ST.Binfo.initial_exact >= ST.Binfo.max_length) {
-
- /* Here, the mask is all 1's for the entire length of
- * any possible match. (That actually means that there
- * is only one possible match.) Look for the next
- * occurrence */
- locinput = ninstr(locinput, loceol,
- (char *) ST.Binfo.matches,
- (char *) ST.Binfo.matches
- + ST.Binfo.initial_exact);
- if (locinput == NULL) {
- sayNO;
- }
- }
- else do {
- /* If the first byte(s) of the mask are all ones, it
- * means those bytes must match identically, so can use
- * ninstr() to find the next possible matchpoint */
- if (ST.Binfo.initial_exact > 0) {
+ if (ST.Binfo.initial_exact >= ST.Binfo.max_length) {
+
+ /* Here, the mask is all 1's for the entire length of
+ * any possible match. (That actually means that there
+ * is only one possible match.) Look for the next
+ * occurrence */
locinput = ninstr(locinput, loceol,
- (char *) ST.Binfo.matches,
- (char *) ST.Binfo.matches
+ (char *) ST.Binfo.matches,
+ (char *) ST.Binfo.matches
+ ST.Binfo.initial_exact);
+ if (locinput == NULL) {
+ sayNO;
+ }
}
- else { /* Otherwise find the next byte that matches,
- masked */
- locinput = (char *) find_next_masked(
- (U8 *) locinput, (U8 *) loceol,
- ST.Binfo.first_byte_anded,
- ST.Binfo.first_byte_mask);
- /* Advance to the end of a multi-byte character */
- if (utf8_target) {
- while ( locinput < loceol
- && UTF8_IS_CONTINUATION(*locinput))
- {
- locinput++;
+ else do {
+ /* If the first byte(s) of the mask are all ones, it
+ * means those bytes must match identically, so can use
+ * ninstr() to find the next possible matchpoint */
+ if (ST.Binfo.initial_exact > 0) {
+ locinput = ninstr(locinput, loceol,
+ (char *) ST.Binfo.matches,
+ (char *) ST.Binfo.matches
+ + ST.Binfo.initial_exact);
+ }
+ else { /* Otherwise find the next byte that matches,
+ masked */
+ locinput = (char *) find_next_masked(
+ (U8 *) locinput, (U8 *) loceol,
+ ST.Binfo.first_byte_anded,
+ ST.Binfo.first_byte_mask);
+ /* Advance to the end of a multi-byte character */
+ if (utf8_target) {
+ while ( locinput < loceol
+ && UTF8_IS_CONTINUATION(*locinput))
+ {
+ locinput++;
+ }
}
}
- }
- if ( locinput == NULL
- || locinput + ST.Binfo.min_length > loceol)
- {
- sayNO;
- }
+ if ( locinput == NULL
+ || locinput + ST.Binfo.min_length > loceol)
+ {
+ sayNO;
+ }
- /* Here, we have found a possible match point; if can't
- * rule it out, quit the loop so can check fully */
- if (S_test_EXACTISH_ST(locinput, ST.Binfo)) {
- break;
- }
+ /* Here, we have found a possible match point; if can't
+ * rule it out, quit the loop so can check fully */
+ if (S_test_EXACTISH_ST(locinput, ST.Binfo)) {
+ break;
+ }
- locinput += (utf8_target) ? UTF8SKIP(locinput) : 1;
+ locinput += (utf8_target) ? UTF8SKIP(locinput) : 1;
- } while (locinput <= ST.maxpos);
+ } while (locinput <= ST.maxpos);
}
if (locinput > ST.maxpos)