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

Method ResolveGoto

compile.go:458–465  ·  view source on GitHub ↗
(from, to *gotoLabelDesc, index int)

Source from the content-addressed store, hash-verified

456}
457
458func (fc *funcContext) ResolveGoto(from, to *gotoLabelDesc, index int) {
459 if from.NumActiveLocalVars < to.NumActiveLocalVars {
460 varName := fc.Block.LocalVars.Names()[len(fc.Block.LocalVars.Names())-1]
461 raiseCompileError(fc, to.Line+1, "<goto %s> at line %d jumps into the scope of local '%s'", to.Name, from.Line, varName)
462 }
463 fc.Code.SetSbx(from.Pc, to.Id)
464 delete(fc.unresolvedGotos, index)
465}
466
467func (fc *funcContext) FindLabel(block *codeBlock, gotoLabel *gotoLabelDesc, i int) bool {
468 target := block.GetLabel(gotoLabel.Name)

Callers 2

FindLabelMethod · 0.95
ResolveForwardGotoMethod · 0.95

Calls 3

raiseCompileErrorFunction · 0.85
NamesMethod · 0.80
SetSbxMethod · 0.80

Tested by

no test coverage detected