MCPcopy
hub / github.com/yuin/gopher-lua / compileLabelStmt

Function compileLabelStmt

compile.go:1124–1132  ·  view source on GitHub ↗

}}}

(context *funcContext, stmt *ast.LabelStmt, isLastStmt bool)

Source from the content-addressed store, hash-verified

1122} // }}}
1123
1124func compileLabelStmt(context *funcContext, stmt *ast.LabelStmt, isLastStmt bool) { // {{{
1125 labelId := context.NewLabel()
1126 label := newLabelDesc(labelId, stmt.Name, context.Code.LastPC(), sline(stmt), context.BlockLocalVarsCount())
1127 context.AddNamedLabel(label)
1128 if isLastStmt {
1129 label.SetNumActiveLocalVars(context.Block.Parent.LocalVarsCount())
1130 }
1131 context.ResolveForwardGoto(label)
1132} // }}}
1133
1134func compileGotoStmt(context *funcContext, stmt *ast.GotoStmt) { // {{{
1135 context.Code.AddABC(OP_CLOSE, 0, 0, 0, sline(stmt))

Callers 1

compileStmtFunction · 0.85

Calls 9

newLabelDescFunction · 0.85
slineFunction · 0.85
NewLabelMethod · 0.80
LastPCMethod · 0.80
BlockLocalVarsCountMethod · 0.80
AddNamedLabelMethod · 0.80
SetNumActiveLocalVarsMethod · 0.80
LocalVarsCountMethod · 0.80
ResolveForwardGotoMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…