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

Method SearchBitState

extern/re2/re2/bitstate.cc:356–383  ·  view source on GitHub ↗

Bit-state search.

Source from the content-addressed store, hash-verified

354
355// Bit-state search.
356bool Prog::SearchBitState(const StringPiece& text,
357 const StringPiece& context,
358 Anchor anchor,
359 MatchKind kind,
360 StringPiece* match,
361 int nmatch) {
362 // If full match, we ask for an anchored longest match
363 // and then check that match[0] == text.
364 // So make sure match[0] exists.
365 StringPiece sp0;
366 if (kind == kFullMatch) {
367 anchor = kAnchored;
368 if (nmatch < 1) {
369 match = &sp0;
370 nmatch = 1;
371 }
372 }
373
374 // Run the search.
375 BitState b(this);
376 bool anchored = anchor == kAnchored;
377 bool longest = kind != kFirstMatch;
378 if (!b.Search(text, context, anchored, longest, match, nmatch))
379 return false;
380 if (kind == kFullMatch && match[0].end() != text.end())
381 return false;
382 return true;
383}
384
385} // namespace re2

Callers 8

MatchMethod · 0.80
RunSearchMethod · 0.80
SearchBitStateFunction · 0.80
SearchCachedBitStateFunction · 0.80
Parse3BitStateFunction · 0.80
Parse3CachedBitStateFunction · 0.80
Parse1BitStateFunction · 0.80
Parse1CachedBitStateFunction · 0.80

Calls 2

SearchMethod · 0.45
endMethod · 0.45

Tested by 1

RunSearchMethod · 0.64