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

Method FindLocalVarAndBlock

compile.go:551–558  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

549}
550
551func (fc *funcContext) FindLocalVarAndBlock(name string) (int, *codeBlock) {
552 for block := fc.Block; block != nil; block = block.Parent {
553 if index := block.LocalVars.Find(name); index > -1 {
554 return index, block
555 }
556 }
557 return -1, nil
558}
559
560func (fc *funcContext) FindLocalVar(name string) int {
561 idx, _ := fc.FindLocalVarAndBlock(name)

Callers 2

FindLocalVarMethod · 0.95
compileExprFunction · 0.80

Calls 1

FindMethod · 0.80

Tested by

no test coverage detected