MCPcopy Index your code
hub / github.com/Shopify/go-lua / closeGoto

Method closeGoto

code.go:179–187  ·  view source on GitHub ↗
(i int, l label)

Source from the content-addressed store, hash-verified

177}
178
179func (f *function) closeGoto(i int, l label) {
180 g := f.p.pendingGotos[i]
181 if f.assert(g.name == l.name); g.activeVariableCount < l.activeVariableCount {
182 f.semanticError(fmt.Sprintf("<goto %s> at line %d jumps into the scope of local '%s'", g.name, g.line, f.LocalVariable(g.activeVariableCount).name))
183 }
184 f.PatchList(g.pc, l.pc)
185 copy(f.p.pendingGotos[i:], f.p.pendingGotos[i+1:])
186 f.p.pendingGotos = f.p.pendingGotos[:len(f.p.pendingGotos)-1]
187}
188
189func (f *function) findLabel(i int) int {
190 g, b := f.p.pendingGotos[i], f.block

Callers 2

findLabelMethod · 0.95
FindGotosMethod · 0.95

Calls 4

assertMethod · 0.95
semanticErrorMethod · 0.95
LocalVariableMethod · 0.95
PatchListMethod · 0.95

Tested by

no test coverage detected