summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-02-03 10:32:15 -0700
committerKarl Williamson <public@khwilliamson.com>2012-02-09 10:13:54 -0700
commit52ae8f7ebb1f32bbd4f574c090ff4ae9d6b468c7 (patch)
tree77b71b06f5772f2e2ad5e2b8a849759d5f5591c6 /regexp.h
parent112b0fc601abb62ef38610a2a8edb67f8f59fade (diff)
downloadperl-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/regexp.h b/regexp.h
index b24a6391bc..aefdac8f8f 100644
--- a/regexp.h
+++ b/regexp.h
@@ -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