MCPcopy Index your code
hub / github.com/yuin/gopher-lua / checkCaptureIndex

Function checkCaptureIndex

stringlib.go:181–188  ·  view source on GitHub ↗
(L *LState, m *pm.MatchData, idx int)

Source from the content-addressed store, hash-verified

179}
180
181func checkCaptureIndex(L *LState, m *pm.MatchData, idx int) {
182 if idx <= 2 {
183 return
184 }
185 if idx >= m.CaptureLength() {
186 L.RaiseError("invalid capture index")
187 }
188}
189
190func capturedString(L *LState, m *pm.MatchData, str string, idx int) string {
191 checkCaptureIndex(L, m, idx)

Callers 1

capturedStringFunction · 0.85

Calls 2

CaptureLengthMethod · 0.80
RaiseErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…