This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Rename static fcn to better reflect its purpose
authorKarl Williamson <public@khwilliamson.com>
Sun, 17 Jun 2012 02:02:07 +0000 (20:02 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 2 Aug 2012 15:24:52 +0000 (09:24 -0600)
This function handles \N of any ilk, not just named sequences.

embed.fnc
embed.h
proto.h
regcomp.c

index 7968ece..97b0a9f 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1934,7 +1934,7 @@ Es        |regnode*|reg_node      |NN struct RExC_state_t *pRExC_state|U8 op
 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 \
+Es     |regnode*|grok_bslash_N|NN struct RExC_state_t *pRExC_state \
                                |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
diff --git a/embed.h b/embed.h
index aa950c4..bb96c46 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define get_invlist_len_addr(a)        S_get_invlist_len_addr(aTHX_ a)
 #define get_invlist_version_id_addr(a) S_get_invlist_version_id_addr(aTHX_ a)
 #define get_invlist_zero_addr(a)       S_get_invlist_zero_addr(aTHX_ a)
+#define grok_bslash_N(a,b,c,d) S_grok_bslash_N(aTHX_ a,b,c,d)
 #define invlist_array(a)       S_invlist_array(aTHX_ a)
 #define invlist_clone(a)       S_invlist_clone(aTHX_ a)
 #define invlist_extend(a,b)    S_invlist_extend(aTHX_ a,b)
 #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,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 2ecd0ec..433d32a 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6458,6 +6458,11 @@ PERL_STATIC_INLINE UV*   S_get_invlist_zero_addr(pTHX_ SV* invlist)
 #define PERL_ARGS_ASSERT_GET_INVLIST_ZERO_ADDR \
        assert(invlist)
 
+STATIC regnode*        S_grok_bslash_N(pTHX_ struct RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 depth)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_GROK_BSLASH_N \
+       assert(pRExC_state)
+
 PERL_STATIC_INLINE UV* S_invlist_array(pTHX_ SV* const invlist)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -6564,11 +6569,6 @@ 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, U32 depth)
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_REG_NAMEDSEQ  \
-       assert(pRExC_state)
-
 STATIC regnode*        S_reg_node(pTHX_ struct RExC_state_t *pRExC_state, U8 op)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_REG_NODE      \
index 724899e..16c5cf2 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -9579,7 +9579,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 }
 
 
-/* reg_namedseq(pRExC_state,UVp, UV depth)
+/* grok_bslash_N(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
@@ -9622,7 +9622,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, U32 depth)
+S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 depth)
 {
     char * endbrace;    /* '}' following the name */
     regnode *ret = NULL;
@@ -9630,7 +9630,7 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 dept
 
     GET_RE_DEBUG_FLAGS_DECL;
  
-    PERL_ARGS_ASSERT_REG_NAMEDSEQ;
+    PERL_ARGS_ASSERT_GROK_BSLASH_N;
 
     GET_RE_DEBUG_FLAGS;
 
@@ -10249,7 +10249,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, depth);
+            ret= grok_bslash_N(pRExC_state, NULL, flagp, depth);
             break;
        case 'k':    /* Handle \k<NAME> and \k'NAME' */
        parse_named_seq:
@@ -11277,7 +11277,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, depth)) {
+                    if (grok_bslash_N(pRExC_state, &v, NULL, depth)) {
                         goto parseit;
                     }
                     value= v;