From: Vincent Pit Date: Sat, 31 Mar 2012 15:06:33 +0000 (+0200) Subject: Hook convertion of branches into tries X-Git-Tag: v0.02~3 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fre-engine-Hooks.git;a=commitdiff_plain;h=9fc90d81cde4cbe8bff27adf3cc3624c86988f1a Hook convertion of branches into tries --- diff --git a/src/5010001/regcomp.c b/src/5010001/regcomp.c index 924c7f8..d6bfde6 100644 --- a/src/5010001/regcomp.c +++ b/src/5010001/regcomp.c @@ -2136,6 +2136,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011000/regcomp.c b/src/5011000/regcomp.c index c5edf44..b17c71b 100644 --- a/src/5011000/regcomp.c +++ b/src/5011000/regcomp.c @@ -2138,6 +2138,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011001/regcomp.c b/src/5011001/regcomp.c index 447d4ae..b68a456 100644 --- a/src/5011001/regcomp.c +++ b/src/5011001/regcomp.c @@ -2149,6 +2149,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011002/regcomp.c b/src/5011002/regcomp.c index b7eb2fb..683a7c4 100644 --- a/src/5011002/regcomp.c +++ b/src/5011002/regcomp.c @@ -2149,6 +2149,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011003/regcomp.c b/src/5011003/regcomp.c index 1345371..1f9c84f 100644 --- a/src/5011003/regcomp.c +++ b/src/5011003/regcomp.c @@ -2149,6 +2149,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011004/regcomp.c b/src/5011004/regcomp.c index 1345371..1f9c84f 100644 --- a/src/5011004/regcomp.c +++ b/src/5011004/regcomp.c @@ -2149,6 +2149,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5011005/regcomp.c b/src/5011005/regcomp.c index bc51c8e..fa4caf6 100644 --- a/src/5011005/regcomp.c +++ b/src/5011005/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5012000/regcomp.c b/src/5012000/regcomp.c index aa8bf54..1053849 100644 --- a/src/5012000/regcomp.c +++ b/src/5012000/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5012001/regcomp.c b/src/5012001/regcomp.c index 4039ff2..2d4110b 100644 --- a/src/5012001/regcomp.c +++ b/src/5012001/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5012002/regcomp.c b/src/5012002/regcomp.c index 4039ff2..2d4110b 100644 --- a/src/5012002/regcomp.c +++ b/src/5012002/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5012003/regcomp.c b/src/5012003/regcomp.c index 4039ff2..2d4110b 100644 --- a/src/5012003/regcomp.c +++ b/src/5012003/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5012004/regcomp.c b/src/5012004/regcomp.c index 4039ff2..2d4110b 100644 --- a/src/5012004/regcomp.c +++ b/src/5012004/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5013000/regcomp.c b/src/5013000/regcomp.c index aa8bf54..1053849 100644 --- a/src/5013000/regcomp.c +++ b/src/5013000/regcomp.c @@ -2147,6 +2147,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); RExC_rxi->data->data[ data_slot + 1 ] = (void*)widecharmap; #ifdef DEBUGGING RExC_rxi->data->data[ data_slot + TRIE_WORDS_OFFSET ] = (void*)trie_words; diff --git a/src/5013001/regcomp.c b/src/5013001/regcomp.c index 2c7f86d..7b11f74 100644 --- a/src/5013001/regcomp.c +++ b/src/5013001/regcomp.c @@ -2159,6 +2159,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013002/regcomp.c b/src/5013002/regcomp.c index 19f1f49..92917f7 100644 --- a/src/5013002/regcomp.c +++ b/src/5013002/regcomp.c @@ -2159,6 +2159,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013003/regcomp.c b/src/5013003/regcomp.c index d7cdba5..4c60123 100644 --- a/src/5013003/regcomp.c +++ b/src/5013003/regcomp.c @@ -2159,6 +2159,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013004/regcomp.c b/src/5013004/regcomp.c index 54c7597..34b7188 100644 --- a/src/5013004/regcomp.c +++ b/src/5013004/regcomp.c @@ -2159,6 +2159,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013005/regcomp.c b/src/5013005/regcomp.c index 97fb42d..cd00b96 100644 --- a/src/5013005/regcomp.c +++ b/src/5013005/regcomp.c @@ -2167,6 +2167,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013006/regcomp.c b/src/5013006/regcomp.c index ef55620..ed96849 100644 --- a/src/5013006/regcomp.c +++ b/src/5013006/regcomp.c @@ -2170,6 +2170,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013007/regcomp.c b/src/5013007/regcomp.c index 5162d30..2c9c953 100644 --- a/src/5013007/regcomp.c +++ b/src/5013007/regcomp.c @@ -2183,6 +2183,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013008/regcomp.c b/src/5013008/regcomp.c index 3f1ba21..794a89c 100644 --- a/src/5013008/regcomp.c +++ b/src/5013008/regcomp.c @@ -2185,6 +2185,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013009/regcomp.c b/src/5013009/regcomp.c index a956d08..835cfd5 100644 --- a/src/5013009/regcomp.c +++ b/src/5013009/regcomp.c @@ -2194,6 +2194,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013010/regcomp.c b/src/5013010/regcomp.c index 7c23c13..cef1124 100644 --- a/src/5013010/regcomp.c +++ b/src/5013010/regcomp.c @@ -2205,6 +2205,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5013011/regcomp.c b/src/5013011/regcomp.c index 0deb100..53d4a40 100644 --- a/src/5013011/regcomp.c +++ b/src/5013011/regcomp.c @@ -2296,6 +2296,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5014000/regcomp.c b/src/5014000/regcomp.c index 9f25d62..36f88ad 100644 --- a/src/5014000/regcomp.c +++ b/src/5014000/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5014001/regcomp.c b/src/5014001/regcomp.c index c8e79b7..a5ac553 100644 --- a/src/5014001/regcomp.c +++ b/src/5014001/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5014002/regcomp.c b/src/5014002/regcomp.c index c8e79b7..a5ac553 100644 --- a/src/5014002/regcomp.c +++ b/src/5014002/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015000/regcomp.c b/src/5015000/regcomp.c index 6627a41..382b1e1 100644 --- a/src/5015000/regcomp.c +++ b/src/5015000/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015001/regcomp.c b/src/5015001/regcomp.c index e59647f..9ca75cb 100644 --- a/src/5015001/regcomp.c +++ b/src/5015001/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015002/regcomp.c b/src/5015002/regcomp.c index 47512c0..4ada8eb 100644 --- a/src/5015002/regcomp.c +++ b/src/5015002/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015003/regcomp.c b/src/5015003/regcomp.c index 47512c0..4ada8eb 100644 --- a/src/5015003/regcomp.c +++ b/src/5015003/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015004/regcomp.c b/src/5015004/regcomp.c index 8bb7fd5..1e762f9 100644 --- a/src/5015004/regcomp.c +++ b/src/5015004/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015005/regcomp.c b/src/5015005/regcomp.c index de97317..3e4ca33 100644 --- a/src/5015005/regcomp.c +++ b/src/5015005/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015006/regcomp.c b/src/5015006/regcomp.c index f687454..a244145 100644 --- a/src/5015006/regcomp.c +++ b/src/5015006/regcomp.c @@ -2321,6 +2321,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015007/regcomp.c b/src/5015007/regcomp.c index d6cc6b7..6a0b96d 100644 --- a/src/5015007/regcomp.c +++ b/src/5015007/regcomp.c @@ -2323,6 +2323,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015008/regcomp.c b/src/5015008/regcomp.c index 8130258..a16bf69 100644 --- a/src/5015008/regcomp.c +++ b/src/5015008/regcomp.c @@ -2326,6 +2326,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/5015009/regcomp.c b/src/5015009/regcomp.c index d517d1f..59c12e0 100644 --- a/src/5015009/regcomp.c +++ b/src/5015009/regcomp.c @@ -2357,6 +2357,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs Set_Node_Offset_Length(convert,mjd_offset,mjd_nodelen); }); } /* end node insert */ + REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert); /* Finish populating the prev field of the wordinfo array. Walk back * from each accept state until we find another accept state, and if diff --git a/src/update.pl b/src/update.pl index a36c99d..1c5e40d 100644 --- a/src/update.pl +++ b/src/update.pl @@ -218,8 +218,16 @@ sub fetch_source_file { my %patched_chunks; my %expected_chunks = ( - 'regcomp.c' => [ qw, ('COMP_NODE_HOOK') x 3 ], - 'regexec.c' => [ qw ], + 'regcomp.c' => [ + 're_defs', + 'COMP_NODE_HOOK', + 'COMP_BEGIN_HOOK', + ('COMP_NODE_HOOK') x 3, + ], + 'regexec.c' => [ + 're_defs', + 'EXEC_NODE_HOOK', + ], ); sub patch_regcomp { @@ -235,6 +243,9 @@ sub patch_regcomp { my $shift = $1 ? 2 : 1; push @{$patched_chunks{$file}}, 'COMP_NODE_HOOK'; return $line, " REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, ($2) - $shift);\n" + } elsif ($line =~ /end node insert/) { + push @{$patched_chunks{$file}}, 'COMP_NODE_HOOK'; + return $line, " REH_CALL_COMP_NODE_HOOK(pRExC_state->rx, convert);\n"; } return $line; diff --git a/t/10-base.t b/t/10-base.t index 0db53dc..565f878 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -5,9 +5,7 @@ use warnings; use blib 't/re-engine-Hooks-TestDist'; -use Test::More tests => 6; - -my $res; +use Test::More tests => 4 * 3; my $ops; BEGIN { $ops = [ ] } @@ -18,17 +16,15 @@ BEGIN { $ops = [ ] } BEGIN { @$ops = () } @$ops = (); - $res = "lettuce" =~ /t{2,3}/; + my $res = "lettuce" =~ /t{2,3}/; BEGIN { is "@$ops", 'c:EXACT c:CURLY c:END', 'match compilation'; } is "@$ops", 'e:CURLY e:END', 'match execution'; -} -ok $res, 'regexp match result'; - -my @captures; + ok $res, 'regexp match result'; +} { use re::engine::Hooks::TestDist 'foo'; @@ -36,13 +32,54 @@ my @captures; BEGIN { @$ops = () } @$ops = (); - @captures = "babaorum" =~ /([aeiou])/g; + my @captures = "babaorum" =~ /([aeiou])/g; BEGIN { is "@$ops", 'c:OPEN c:ANYOF c:CLOSE c:END', 'capture compilation'; } my $expect = join ' ', ('e:OPEN e:ANYOF e:CLOSE e:END') x 4; is "@$ops", $expect, 'capture execution'; + + is "@captures", 'a a o u', 'regexp capture result'; +} + +my $expected_comp_branch; +BEGIN { + $expected_comp_branch +} + +{ + use re::engine::Hooks::TestDist 'foo'; + + BEGIN { @$ops = () } + @$ops = (); + + my $res = "tomato" =~ /t(?:z|.)/g; + + BEGIN { + is "@$ops", 'c:EXACT c:EXACT c:BRANCH c:BRANCH c:REG_ANY c:TAIL c:END', + 'branch compilation'; + } + my $expect = join ' ', ('e:EXACT e:BRANCH') x2, 'e:REG_ANY e:END'; + is "@$ops", $expect, 'branch execution'; + + ok $res, 'branch execution result'; } -is "@captures", 'a a o u', 'regexp capture result'; +{ + use re::engine::Hooks::TestDist 'foo'; + + BEGIN { @$ops = () } + @$ops = (); + + my $res = "potato" =~ /t(?:z|o)/g; + + BEGIN { + is "@$ops", 'c:EXACT c:EXACT c:BRANCH c:BRANCH c:EXACT c:TAIL c:END c:TRIE', + 'trie compilation'; + } + my $expect = join ' ', ('e:EXACT e:TRIE') x2, 'e:END'; + is "@$ops", $expect, 'trie execution'; + + ok $res, 'trie execution result'; +}