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

Function compileBlock

compile.go:632–652  ·  view source on GitHub ↗

}}}

(context *funcContext, chunk []ast.Stmt)

Source from the content-addressed store, hash-verified

630} // }}}
631
632func compileBlock(context *funcContext, chunk []ast.Stmt) { // {{{
633 if len(chunk) == 0 {
634 return
635 }
636 ph := &ast.Node{}
637 ph.SetLine(sline(chunk[0]))
638 ph.SetLastLine(eline(chunk[len(chunk)-1]))
639 context.EnterBlock(labelNoJump, ph)
640 for i, stmt := range chunk {
641 lastStmt := true
642 for j := i + 1; j < len(chunk); j++ {
643 _, ok := chunk[j].(*ast.LabelStmt)
644 if !ok {
645 lastStmt = false
646 break
647 }
648 }
649 compileStmt(context, stmt, lastStmt)
650 }
651 context.LeaveBlock()
652} // }}}
653
654func compileStmt(context *funcContext, stmt ast.Stmt, isLastStmt bool) { // {{{
655 switch st := stmt.(type) {

Callers 1

compileIfStmtFunction · 0.85

Calls 7

SetLineMethod · 0.95
SetLastLineMethod · 0.95
slineFunction · 0.85
elineFunction · 0.85
compileStmtFunction · 0.85
EnterBlockMethod · 0.80
LeaveBlockMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…