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

Function strGmatch

stringlib.go:327–339  ·  view source on GitHub ↗
(L *LState)

Source from the content-addressed store, hash-verified

325}
326
327func strGmatch(L *LState) int {
328 str := L.CheckString(1)
329 pattern := L.CheckString(2)
330 mds, err := pm.Find(pattern, []byte(str), 0, -1)
331 if err != nil {
332 L.RaiseError(err.Error())
333 }
334 L.Push(L.Get(UpvalueIndex(1)))
335 ud := L.NewUserData()
336 ud.Value = &strMatchData{str, 0, mds}
337 L.Push(ud)
338 return 2
339}
340
341func strLen(L *LState) int {
342 str := L.CheckString(1)

Callers

nothing calls this directly

Calls 8

FindFunction · 0.92
UpvalueIndexFunction · 0.85
CheckStringMethod · 0.80
ErrorMethod · 0.65
PushMethod · 0.65
RaiseErrorMethod · 0.45
GetMethod · 0.45
NewUserDataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…