diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-02-03 10:32:15 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-02-09 10:13:54 -0700 |
commit | 52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7 (patch) | |
tree | 77b71b06f5772f2e2ad5e2b8a849759d5f5591c6 /regexp.h | |
parent | 112b0fc601abb62ef38610a2a8edb67f8f59fade (diff) | |
download | perl-52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7.tar.gz |
regcomp.c: Add ability to take intersection of complement
It turns out that it is a common paradigm to want to take the
intersection of an inversion list with the complement of another
inversion list. In fact, this is the how to subtract the second
inversion list from the first, as what remains in the first after the
subtraction is everything in it that is not in the second.
It also turns out that it adds very few cycles to an intersection to
complement one (or both, should we choose to) of the operands. By
adding this capability, we don't have to create a copy of the inverted
operand beforehand, just to throw it away.
Diffstat (limited to 'regexp.h')
-rw-r--r-- | regexp.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -55,6 +55,10 @@ typedef struct regexp_paren_pair { I32 end; } regexp_paren_pair; +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C) +#define _invlist_intersection(a, b, output) _invlist_intersection_maybe_complement_2nd(a, b, FALSE, output) +#endif + /* The regexp/REGEXP struct, see L<perlreapi> for further documentation on the individual fields. The struct is ordered so that the most |