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

Method Quest

extern/re2/re2/compile.cc:347–362  ·  view source on GitHub ↗

Given a fragment for a, returns a fragment for a? or a?? (if nongreedy)

Source from the content-addressed store, hash-verified

345
346// Given a fragment for a, returns a fragment for a? or a?? (if nongreedy)
347Frag Compiler::Quest(Frag a, bool nongreedy) {
348 if (IsNoMatch(a))
349 return Nop();
350 int id = AllocInst(1);
351 if (id < 0)
352 return NoMatch();
353 PatchList pl;
354 if (nongreedy) {
355 inst_[id].InitAlt(0, a.begin);
356 pl = PatchList::Mk(id << 1);
357 } else {
358 inst_[id].InitAlt(a.begin, 0);
359 pl = PatchList::Mk((id << 1) | 1);
360 }
361 return Frag(id, PatchList::Append(inst_.data(), pl, a.end));
362}
363
364// Returns a fragment for the byte range lo-hi.
365Frag Compiler::ByteRange(int lo, int hi, bool foldcase) {

Callers

nothing calls this directly

Calls 4

IsNoMatchFunction · 0.85
FragClass · 0.85
InitAltMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected