MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / RemoveAbove

Method RemoveAbove

extern/re2/re2/regexp.cc:850–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

848
849
850void CharClassBuilder::RemoveAbove(Rune r) {
851 if (r >= Runemax)
852 return;
853
854 if (r < 'z') {
855 if (r < 'a')
856 lower_ = 0;
857 else
858 lower_ &= AlphaMask >> ('z' - r);
859 }
860
861 if (r < 'Z') {
862 if (r < 'A')
863 upper_ = 0;
864 else
865 upper_ &= AlphaMask >> ('Z' - r);
866 }
867
868 for (;;) {
869
870 iterator it = ranges_.find(RuneRange(r + 1, Runemax));
871 if (it == end())
872 break;
873 RuneRange rr = *it;
874 ranges_.erase(it);
875 nrunes_ -= rr.hi - rr.lo + 1;
876 if (rr.lo <= r) {
877 rr.hi = r;
878 ranges_.insert(rr);
879 nrunes_ += rr.hi - rr.lo + 1;
880 }
881 }
882}
883
884void CharClassBuilder::Negate() {
885 // Build up negation and then copy in.

Callers 2

PushRegexpMethod · 0.80
TESTFunction · 0.80

Calls 5

RuneRangeClass · 0.85
endFunction · 0.50
findMethod · 0.45
eraseMethod · 0.45
insertMethod · 0.45

Tested by 1

TESTFunction · 0.64