Given a fragment a, returns a fragment with capturing parens around a.
| 399 | |
| 400 | // Given a fragment a, returns a fragment with capturing parens around a. |
| 401 | Frag 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. |
nothing calls this directly
no test coverage detected