summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-06-26 13:09:25 -0600
committerKarl Williamson <khw@cpan.org>2014-06-26 18:09:19 -0600
commitae7c5b9bcea1e06708978024a3f9c6409468ad51 (patch)
tree73769982af79ae6e9589e87bd7a4d5407bb9f248 /regexec.c
parentc8519dc797997ef2e60f58f25157026584a20c1e (diff)
downloadperl-ae7c5b9bcea1e06708978024a3f9c6409468ad51.tar.gz
regexec.c: Move some macro definitions around
This puts them in a more logical order
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/regexec.c b/regexec.c
index 9d9765e08d..0fc53c9a46 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1502,6 +1502,10 @@ STMT_START {
} \
} STMT_END
+#define DUMP_EXEC_POS(li,s,doutf8) \
+ dump_exec_pos(li,s,(reginfo->strend),(reginfo->strbeg), \
+ startpos, doutf8)
+
#define REXEC_FBC_EXACTISH_SCAN(COND) \
STMT_START { \
while (s <= e) { \
@@ -1553,12 +1557,6 @@ REXEC_FBC_SCAN( /* Loops while (s < strend) */ \
tmp = 1; \
)
-/* This is the macro to use when we want to see if something that looks like it
- * could match, actually does, and if so exits the loop */
-#define REXEC_FBC_TRYIT \
- if ((reginfo->intuit || regtry(reginfo, &s))) \
- goto got_it
-
#define REXEC_FBC_CSCAN(CONDUTF8,COND) \
if (utf8_target) { \
REXEC_FBC_UTF8_CLASS_SCAN(CONDUTF8); \
@@ -1567,10 +1565,6 @@ REXEC_FBC_SCAN( /* Loops while (s < strend) */ \
REXEC_FBC_CLASS_SCAN(COND); \
}
-#define DUMP_EXEC_POS(li,s,doutf8) \
- dump_exec_pos(li,s,(reginfo->strend),(reginfo->strbeg), \
- startpos, doutf8)
-
/* 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
@@ -1644,34 +1638,6 @@ REXEC_FBC_SCAN( /* Loops while (s < strend) */ \
} \
);
-/* The only difference between the BOUND and NBOUND cases is that
- * REXEC_FBC_TRYIT is called when matched in BOUND, and when non-matched in
- * NBOUND. This is accomplished by passing it as either the if or else clause,
- * with the other one being empty (PLACEHOLDER is defined as empty).
- *
- * The TEST_FOO parameters are for operating on different forms of input, but
- * all should be ones that return identically for the same underlying code
- * points */
-#define FBC_BOUND(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
- FBC_BOUND_COMMON( \
- FBC_UTF8(TEST_UV, TEST_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER), \
- TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER)
-
-#define FBC_BOUND_A(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
- FBC_BOUND_COMMON( \
- FBC_UTF8_A(TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER), \
- TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER)
-
-#define FBC_NBOUND(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
- FBC_BOUND_COMMON( \
- FBC_UTF8(TEST_UV, TEST_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT), \
- TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT)
-
-#define FBC_NBOUND_A(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
- FBC_BOUND_COMMON( \
- FBC_UTF8_A(TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT), \
- TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT)
-
/* Like the above two macros. UTF8_CODE is the complete code for handling
* UTF-8. Common to the BOUND and NBOUND cases, set-up by the FBC_BOUND, etc
* macros below */
@@ -1705,6 +1671,40 @@ REXEC_FBC_SCAN( /* Loops while (s < strend) */ \
IF_FAIL; \
}
+/* This is the macro to use when we want to see if something that looks like it
+ * could match, actually does, and if so exits the loop */
+#define REXEC_FBC_TRYIT \
+ if ((reginfo->intuit || regtry(reginfo, &s))) \
+ goto got_it
+
+/* The only difference between the BOUND and NBOUND cases is that
+ * REXEC_FBC_TRYIT is called when matched in BOUND, and when non-matched in
+ * NBOUND. This is accomplished by passing it as either the if or else clause,
+ * with the other one being empty (PLACEHOLDER is defined as empty).
+ *
+ * The TEST_FOO parameters are for operating on different forms of input, but
+ * all should be ones that return identically for the same underlying code
+ * points */
+#define FBC_BOUND(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
+ FBC_BOUND_COMMON( \
+ FBC_UTF8(TEST_UV, TEST_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER), \
+ TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER)
+
+#define FBC_BOUND_A(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
+ FBC_BOUND_COMMON( \
+ FBC_UTF8_A(TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER), \
+ TEST_NON_UTF8, REXEC_FBC_TRYIT, PLACEHOLDER)
+
+#define FBC_NBOUND(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
+ FBC_BOUND_COMMON( \
+ FBC_UTF8(TEST_UV, TEST_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT), \
+ TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT)
+
+#define FBC_NBOUND_A(TEST_NON_UTF8, TEST_UV, TEST_UTF8) \
+ FBC_BOUND_COMMON( \
+ FBC_UTF8_A(TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT), \
+ TEST_NON_UTF8, PLACEHOLDER, REXEC_FBC_TRYIT)
+
/* We know what class REx starts with. Try to find this position... */
/* if reginfo->intuit, its a dryrun */