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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
my %patched_chunks;
my %expected_chunks = (
- 'regcomp.c' => [ qw<re_defs COMP_BEGIN_HOOK>, ('COMP_NODE_HOOK') x 3 ],
- 'regexec.c' => [ qw<re_defs EXEC_NODE_HOOK> ],
+ '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 {
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;
use blib 't/re-engine-Hooks-TestDist';
-use Test::More tests => 6;
-
-my $res;
+use Test::More tests => 4 * 3;
my $ops;
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';
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';
+}