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

Method Capture

extern/re2/re2/compile.cc:401–412  ·  view source on GitHub ↗

Given a fragment a, returns a fragment with capturing parens around a.

Source from the content-addressed store, hash-verified

399
400// Given a fragment a, returns a fragment with capturing parens around a.
401Frag Compiler::Capture(Frag a, int n) {
402 if (IsNoMatch(a))
403 return NoMatch();
404 int id = AllocInst(2);
405 if (id < 0)
406 return NoMatch();
407 inst_[id].InitCapture(2*n, a.begin);
408 inst_[id+1].InitCapture(2*n+1, 0);
409 PatchList::Patch(inst_.data(), a.end, id+1);
410
411 return Frag(id, PatchList::Mk((id+1) << 1));
412}
413
414// A Rune is a name for a Unicode code point.
415// Returns maximum rune encoded by UTF-8 sequence of length len.

Callers

nothing calls this directly

Calls 4

IsNoMatchFunction · 0.85
FragClass · 0.85
InitCaptureMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected