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

Method repeatStatement

parser.go:460–474  ·  view source on GitHub ↗
(line int)

Source from the content-addressed store, hash-verified

458}
459
460func (p *parser) repeatStatement(line int) {
461 top := p.function.Label()
462 p.function.EnterBlock(true) // loop block
463 p.function.EnterBlock(false) // scope block
464 p.next()
465 p.statementList()
466 p.checkMatch(tkUntil, tkRepeat, line)
467 conditionExit := p.condition()
468 if p.function.block.hasUpValue {
469 p.function.PatchClose(conditionExit, p.function.block.activeVariableCount)
470 }
471 p.function.LeaveBlock() // finish scope
472 p.function.PatchList(conditionExit, top) // close loop
473 p.function.LeaveBlock() // finish loop
474}
475
476func (p *parser) condition() int {
477 e := p.expression()

Callers 1

statementMethod · 0.95

Calls 9

statementListMethod · 0.95
conditionMethod · 0.95
LabelMethod · 0.80
EnterBlockMethod · 0.80
checkMatchMethod · 0.80
PatchCloseMethod · 0.80
LeaveBlockMethod · 0.80
PatchListMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected