diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-07-22 22:00:46 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-07-24 21:13:50 -0600 |
commit | 4fa0f9a5038a4631f76500c0f52628539e948575 (patch) | |
tree | 370779a7ec15d41b603b3fdac702bbbe5bd3c1e6 /regcomp.c | |
parent | 3fdfee00f5725ab9aa90050f7da00296d201cbed (diff) | |
download | perl-4fa0f9a5038a4631f76500c0f52628539e948575.tar.gz |
regcomp.c: Add _invlist_contains_cp
This simply searches an inversion list without going through a swash.
It will be used in a future commit.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -7938,6 +7938,18 @@ Perl__add_range_to_invlist(pTHX_ SV* invlist, const UV start, const UV end) #endif +STATIC bool +S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp) +{ + /* Does <invlist> contain code point <cp> as part of the set? */ + + IV index = invlist_search(invlist, cp); + + PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP; + + return index >= 0 && ELEMENT_RANGE_MATCHES_INVLIST(index); +} + PERL_STATIC_INLINE SV* S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) { return _add_range_to_invlist(invlist, cp, cp); |