This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for the exec warning category change
[perl5.git] / regexp.h
index cedeb56..a86963c 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -576,6 +576,8 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
 
 #define FBMrf_MULTILINE        1
 
+struct regmatch_state;
+struct regmatch_slab;
 
 /* like regmatch_info_aux, but contains extra fields only needed if the
  * pattern contains (?{}). If used, is snuck into the second slot in the
@@ -602,6 +604,9 @@ typedef struct {
 
 typedef struct {
     regmatch_info_aux_eval *info_aux_eval;
+    struct regmatch_state *old_regmatch_state; /* saved PL_regmatch_state */
+    struct regmatch_slab  *old_regmatch_slab;  /* saved PL_regmatch_slab */
+    char *poscache;    /* S-L cache of fail positions of WHILEMs */
 } regmatch_info_aux;
 
 
@@ -613,17 +618,18 @@ typedef struct {
  * regmatch_state union. */
 
 typedef struct {
-    REGEXP *prog;
+    REGEXP *prog;        /* the regex being executed */
     const char * strbeg; /* real start of string */
-    char *strend;   /* one byte beyond last char of match string */
-    char *till;
-    SV *sv;
-    char *ganch;
-    char *cutpoint;
+    char *strend;        /* one byte beyond last char of match string */
+    char *till;          /* matches shorter than this fail (see minlen arg) */
+    SV *sv;              /* the SV string currently being matched */
+    char *ganch;         /* position of \G anchor */
+    char *cutpoint;      /* (*COMMIT) position (if any) */
     regmatch_info_aux      *info_aux; /* extra fields that need cleanup */
     regmatch_info_aux_eval *info_aux_eval; /* extra saved state for (?{}) */
     I32  poscache_maxiter; /* how many whilems todo before S-L cache kicks in */
     I32  poscache_iter;    /* current countdown from _maxiter to zero */
+    STRLEN poscache_size;  /* size of regmatch_info_aux.poscache */
     bool intuit;    /* re_intuit_start() is the top-level caller */
     bool is_utf8_pat;    /* regex is utf8 */
     bool is_utf8_target; /* string being matched is utf8 */
@@ -822,20 +828,7 @@ typedef struct regmatch_slab {
     struct regmatch_slab *prev, *next;
 } regmatch_slab;
 
-#define PL_reg_curpm           PL_reg_state.re_state_reg_curpm
-#define PL_reg_poscache                PL_reg_state.re_state_reg_poscache
-#define PL_reg_poscache_size   PL_reg_state.re_state_reg_poscache_size
-#define PL_reg_starttry                PL_reg_state.re_state_reg_starttry
 
-struct re_save_state {
-    PMOP *re_state_reg_curpm;          /* from regexec.c */
-    STRLEN re_state_reg_poscache_size; /* size of pos cache of WHILEM */
-    char *re_state_reg_poscache;       /* cache of pos of WHILEM */
-    char *re_state_reg_starttry;       /* from regexec.c */
-};
-
-#define SAVESTACK_ALLOC_FOR_RE_SAVE_STATE \
-       (1 + ((sizeof(struct re_save_state) - 1) / sizeof(*PL_savestack)))
 
 /*
  * Local variables: