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

Method RegisterLocalVar

compile.go:544–549  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

542}
543
544func (fc *funcContext) RegisterLocalVar(name string) int {
545 ret := fc.Block.LocalVars.Register(name)
546 fc.Proto.DbgLocals = append(fc.Proto.DbgLocals, &DbgLocalInfo{Name: name, StartPc: fc.Code.LastPC() + 1})
547 fc.SetRegTop(fc.RegTop() + 1)
548 return ret
549}
550
551func (fc *funcContext) FindLocalVarAndBlock(name string) (int, *codeBlock) {
552 for block := fc.Block; block != nil; block = block.Parent {

Callers 4

compileLocalAssignStmtFunction · 0.80
compileNumberForStmtFunction · 0.80
compileGenericForStmtFunction · 0.80
compileFunctionExprFunction · 0.80

Calls 4

SetRegTopMethod · 0.95
RegTopMethod · 0.95
LastPCMethod · 0.80
RegisterMethod · 0.45

Tested by

no test coverage detected