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

Method AddNamedLabel

compile.go:447–452  ·  view source on GitHub ↗
(label *gotoLabelDesc)

Source from the content-addressed store, hash-verified

445}
446
447func (fc *funcContext) AddNamedLabel(label *gotoLabelDesc) {
448 if old := fc.Block.AddLabel(label); old != nil {
449 raiseCompileError(fc, label.Line+1, "label '%s' already defined on line %d", label.Name, old.Line)
450 }
451 fc.SetLabelPc(label.Id, label.Pc)
452}
453
454func (fc *funcContext) GetNamedLabel(name string) *gotoLabelDesc {
455 return fc.Block.GetLabel(name)

Callers 1

compileLabelStmtFunction · 0.80

Calls 3

SetLabelPcMethod · 0.95
raiseCompileErrorFunction · 0.85
AddLabelMethod · 0.80

Tested by

no test coverage detected