summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-01-29 09:51:45 -0700
committerKarl Williamson <khw@cpan.org>2018-01-29 16:29:44 -0700
commit1971914578c14bb2ffc687f6556c41148781acfc (patch)
tree6097ed86e95e8e095afca29ece494462feab0c3a /regexec.c
parent21d1ed54f05b0cc903eaa25cbc4575df1a5a89ed (diff)
downloadperl-1971914578c14bb2ffc687f6556c41148781acfc.tar.gz
regexec.c: Extract some macro code into a submacro
A future commit will reuse this code, so will avoid duplication.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/regexec.c b/regexec.c
index 534510a64c..072d3f9386 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1737,12 +1737,7 @@ STMT_START { \
#define REXEC_FBC_CLASS_SCAN_GUTS(UTF8, COND) \
if (COND) { \
- if ( ( doevery \
- || s != previous_occurrence_end) \
- && (reginfo->intuit || regtry(reginfo, &s))) \
- { \
- goto got_it; \
- } \
+ FBC_CHECK_AND_TRY \
s += ((UTF8) ? UTF8SKIP(s) : 1); \
previous_occurrence_end = s; \
} \
@@ -1758,6 +1753,14 @@ STMT_START { \
REXEC_FBC_CLASS_SCAN(0, COND); \
}
+#define FBC_CHECK_AND_TRY \
+ if ( ( doevery \
+ || s != previous_occurrence_end) \
+ && (reginfo->intuit || regtry(reginfo, &s))) \
+ { \
+ goto got_it; \
+ }
+
/* The three macros below are slightly different versions of the same logic.
*
* The first is for /a and /aa when the target string is UTF-8. This can only