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

Function compileStmt

compile.go:654–687  ·  view source on GitHub ↗

}}}

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

Source from the content-addressed store, hash-verified

652} // }}}
653
654func compileStmt(context *funcContext, stmt ast.Stmt, isLastStmt bool) { // {{{
655 switch st := stmt.(type) {
656 case *ast.AssignStmt:
657 compileAssignStmt(context, st)
658 case *ast.LocalAssignStmt:
659 compileLocalAssignStmt(context, st)
660 case *ast.FuncCallStmt:
661 compileFuncCallExpr(context, context.RegTop(), st.Expr.(*ast.FuncCallExpr), ecnone(-1))
662 case *ast.DoBlockStmt:
663 context.EnterBlock(labelNoJump, st)
664 compileChunk(context, st.Stmts, false)
665 context.LeaveBlock()
666 case *ast.WhileStmt:
667 compileWhileStmt(context, st)
668 case *ast.RepeatStmt:
669 compileRepeatStmt(context, st)
670 case *ast.FuncDefStmt:
671 compileFuncDefStmt(context, st)
672 case *ast.ReturnStmt:
673 compileReturnStmt(context, st)
674 case *ast.IfStmt:
675 compileIfStmt(context, st)
676 case *ast.BreakStmt:
677 compileBreakStmt(context, st)
678 case *ast.NumberForStmt:
679 compileNumberForStmt(context, st)
680 case *ast.GenericForStmt:
681 compileGenericForStmt(context, st)
682 case *ast.LabelStmt:
683 compileLabelStmt(context, st, isLastStmt)
684 case *ast.GotoStmt:
685 compileGotoStmt(context, st)
686 }
687} // }}}
688
689func compileAssignStmtLeft(context *funcContext, stmt *ast.AssignStmt) (int, []*assigncontext) { // {{{
690 reg := context.RegTop()

Callers 2

compileChunkFunction · 0.85
compileBlockFunction · 0.85

Calls 15

compileAssignStmtFunction · 0.85
compileLocalAssignStmtFunction · 0.85
compileFuncCallExprFunction · 0.85
ecnoneFunction · 0.85
compileChunkFunction · 0.85
compileWhileStmtFunction · 0.85
compileRepeatStmtFunction · 0.85
compileFuncDefStmtFunction · 0.85
compileReturnStmtFunction · 0.85
compileIfStmtFunction · 0.85
compileBreakStmtFunction · 0.85
compileNumberForStmtFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…