MCPcopy Create free account
hub / github.com/yuin/gopher-lua / FindLabel

Method FindLabel

compile.go:467–477  ·  view source on GitHub ↗
(block *codeBlock, gotoLabel *gotoLabelDesc, i int)

Source from the content-addressed store, hash-verified

465}
466
467func (fc *funcContext) FindLabel(block *codeBlock, gotoLabel *gotoLabelDesc, i int) bool {
468 target := block.GetLabel(gotoLabel.Name)
469 if target != nil {
470 if gotoLabel.NumActiveLocalVars > target.NumActiveLocalVars && block.RefUpvalue {
471 fc.Code.SetA(gotoLabel.Pc-1, target.NumActiveLocalVars)
472 }
473 fc.ResolveGoto(gotoLabel, target, i)
474 return true
475 }
476 return false
477}
478
479func (fc *funcContext) ResolveCurrentBlockGotosWithParentBlock() {
480 blockActiveLocalVars := fc.Block.Parent.LocalVarsCount()

Callers 2

compileGotoStmtFunction · 0.80

Calls 3

ResolveGotoMethod · 0.95
GetLabelMethod · 0.80
SetAMethod · 0.80

Tested by

no test coverage detected