summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2018-08-18 12:19:16 +0100
committerDavid Mitchell <davem@iabyn.com>2018-08-26 20:57:34 +0100
commit69cd26179c68c48214a282ff90d0d3f2bdb8643c (patch)
tree16c1a45182f6f191b2cd965753746b19755859ba
parent6b72642a6fc3bf2929aeab13ce50cde069cd1661 (diff)
downloadperl-69cd26179c68c48214a282ff90d0d3f2bdb8643c.tar.gz
S_regmatch(): move CLOSE_CAPTURE macro definition
Move this macro to earlier in the file to be with the other functions and macros which deal with setting and restoring captures. No changes (functional or textual) apart from the physical moving of the 13 lines.
-rw-r--r--regexec.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/regexec.c b/regexec.c
index 9410531d4c..170cab2972 100644
--- a/regexec.c
+++ b/regexec.c
@@ -328,6 +328,20 @@ S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen _pDEPTH)
); \
regcpblow(cp)
+/* XXX really need to log other places start/end are set too */
+#define CLOSE_CAPTURE \
+ rex->offs[n].start = rex->offs[n].start_tmp; \
+ rex->offs[n].end = locinput - reginfo->strbeg; \
+ DEBUG_BUFFERS_r(Perl_re_exec_indentf( aTHX_ \
+ "CLOSE: rex=0x%" UVxf " offs=0x%" UVxf ": \\%" UVuf ": set %" IVdf "..%" IVdf "\n", \
+ depth, \
+ PTR2UV(rex), \
+ PTR2UV(rex->offs), \
+ (UV)n, \
+ (IV)rex->offs[n].start, \
+ (IV)rex->offs[n].end \
+ ))
+
#define UNWIND_PAREN(lp, lcp) \
for (n = rex->lastparen; n > lp; n--) \
rex->offs[n].end = -1; \
@@ -7584,19 +7598,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
script_run_begin = (U8 *) locinput;
break;
-/* XXX really need to log other places start/end are set too */
-#define CLOSE_CAPTURE \
- rex->offs[n].start = rex->offs[n].start_tmp; \
- rex->offs[n].end = locinput - reginfo->strbeg; \
- DEBUG_BUFFERS_r(Perl_re_exec_indentf( aTHX_ \
- "CLOSE: rex=0x%" UVxf " offs=0x%" UVxf ": \\%" UVuf ": set %" IVdf "..%" IVdf "\n", \
- depth, \
- PTR2UV(rex), \
- PTR2UV(rex->offs), \
- (UV)n, \
- (IV)rex->offs[n].start, \
- (IV)rex->offs[n].end \
- ))
case CLOSE: /* ) */
n = ARG(scan); /* which paren pair */