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

Method AddRangeFlags

extern/re2/re2/parse.cc:1600–1619  ·  view source on GitHub ↗

Add a range to the character class, but exclude newline if asked. Also handle case folding.

Source from the content-addressed store, hash-verified

1598// Add a range to the character class, but exclude newline if asked.
1599// Also handle case folding.
1600void CharClassBuilder::AddRangeFlags(
1601 Rune lo, Rune hi, Regexp::ParseFlags parse_flags) {
1602
1603 // Take out \n if the flags say so.
1604 bool cutnl = !(parse_flags & Regexp::ClassNL) ||
1605 (parse_flags & Regexp::NeverNL);
1606 if (cutnl && lo <= '\n' && '\n' <= hi) {
1607 if (lo < '\n')
1608 AddRangeFlags(lo, '\n' - 1, parse_flags);
1609 if (hi > '\n')
1610 AddRangeFlags('\n' + 1, hi, parse_flags);
1611 return;
1612 }
1613
1614 // If folding case, add fold-equivalent characters too.
1615 if (parse_flags & Regexp::FoldCase)
1616 AddFoldedRange(this, lo, hi, 0);
1617 else
1618 AddRange(lo, hi);
1619}
1620
1621// Look for a group with the given name.
1622static const UGroup* LookupGroup(const StringPiece& name,

Callers 3

Round3Method · 0.80
AddUGroupFunction · 0.80
ParseCharClassMethod · 0.80

Calls 1

AddFoldedRangeFunction · 0.85

Tested by

no test coverage detected