Add depth parameter to reg_namedseq
authorKarl Williamson <public@khwilliamson.com>
Sun, 20 Mar 2011 16:20:14 +0000 (10:20 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 20 Mar 2011 18:16:12 +0000 (12:16 -0600)
embed.fnc
embed.h
proto.h
regcomp.c

index cc748c8..b891b43 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1787,7 +1787,7 @@ Es        |UV     |reg_recode     |const char value|NN SV **encp
 Es     |regnode*|regpiece      |NN struct RExC_state_t *pRExC_state \
                                |NN I32 *flagp|U32 depth
 Es     |regnode*|reg_namedseq  |NN struct RExC_state_t *pRExC_state \
-                               |NULLOK UV *valuep|NULLOK I32 *flagp
+                               |NULLOK UV *valuep|NULLOK I32 *flagp|U32 depth
 Es     |void   |reginsert      |NN struct RExC_state_t *pRExC_state \
                                |U8 op|NN regnode *opnd|U32 depth
 Es     |void   |regtail        |NN struct RExC_state_t *pRExC_state \
diff --git a/embed.h b/embed.h
index 1ae431d..a9d7ad6 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define make_trie_failtable(a,b,c,d)   S_make_trie_failtable(aTHX_ a,b,c,d)
 #define nextchar(a)            S_nextchar(aTHX_ a)
 #define reg(a,b,c,d)           S_reg(aTHX_ a,b,c,d)
-#define reg_namedseq(a,b,c)    S_reg_namedseq(aTHX_ a,b,c)
+#define reg_namedseq(a,b,c,d)  S_reg_namedseq(aTHX_ a,b,c,d)
 #define reg_node(a,b)          S_reg_node(aTHX_ a,b)
 #define reg_recode(a,b)                S_reg_recode(aTHX_ a,b)
 #define reg_scan_name(a,b)     S_reg_scan_name(aTHX_ a,b)
diff --git a/proto.h b/proto.h
index 03ced95..69ffaa7 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6117,7 +6117,7 @@ STATIC regnode*   S_reg(pTHX_ struct RExC_state_t *pRExC_state, I32 paren, I32 *fl
 #define PERL_ARGS_ASSERT_REG   \
        assert(pRExC_state); assert(flagp)
 
-STATIC regnode*        S_reg_namedseq(pTHX_ struct RExC_state_t *pRExC_state, UV *valuep, I32 *flagp)
+STATIC regnode*        S_reg_namedseq(pTHX_ struct RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 depth)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_REG_NAMEDSEQ  \
        assert(pRExC_state)
index 26c5180..796cefa 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7632,7 +7632,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 }
 
 
-/* reg_namedseq(pRExC_state,UVp)
+/* reg_namedseq(pRExC_state,UVp, UV depth)
    
    This is expected to be called by a parser routine that has 
    recognized '\N' and needs to handle the rest. RExC_parse is
@@ -7675,7 +7675,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
    Parsing failures will generate a fatal error via vFAIL(...)
  */
 STATIC regnode *
-S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp)
+S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 depth)
 {
     char * endbrace;    /* '}' following the name */
     regnode *ret = NULL;
@@ -8439,7 +8439,7 @@ tryagain:
             Also this makes sure that things like /\N{BLAH}+/ and 
             \N{BLAH} being multi char Just Happen. dmq*/
             ++RExC_parse;
-            ret= reg_namedseq(pRExC_state, NULL, flagp); 
+            ret= reg_namedseq(pRExC_state, NULL, flagp, depth);
             break;
        case 'k':    /* Handle \k<NAME> and \k'NAME' */
        parse_named_seq:
@@ -9640,7 +9640,7 @@ parseit:
                     from earlier versions, OTOH that behaviour was broken
                     as well. */
                     UV v; /* value is register so we cant & it /grrr */
-                    if (reg_namedseq(pRExC_state, &v, NULL)) {
+                    if (reg_namedseq(pRExC_state, &v, NULL, depth)) {
                         goto parseit;
                     }
                     value= v;