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

Function compileLocalAssignStmt

compile.go:856–870  ·  view source on GitHub ↗

}}}

(context *funcContext, stmt *ast.LocalAssignStmt)

Source from the content-addressed store, hash-verified

854} // }}}
855
856func compileLocalAssignStmt(context *funcContext, stmt *ast.LocalAssignStmt) { // {{{
857 reg := context.RegTop()
858 if len(stmt.Names) == 1 && len(stmt.Exprs) == 1 {
859 if _, ok := stmt.Exprs[0].(*ast.FunctionExpr); ok {
860 context.RegisterLocalVar(stmt.Names[0])
861 compileRegAssignment(context, stmt.Names, stmt.Exprs, reg, len(stmt.Names), sline(stmt))
862 return
863 }
864 }
865
866 compileRegAssignment(context, stmt.Names, stmt.Exprs, reg, len(stmt.Names), sline(stmt))
867 for _, name := range stmt.Names {
868 context.RegisterLocalVar(name)
869 }
870} // }}}
871
872func compileReturnStmt(context *funcContext, stmt *ast.ReturnStmt) { // {{{
873 lenexprs := len(stmt.Exprs)

Callers 1

compileStmtFunction · 0.85

Calls 4

compileRegAssignmentFunction · 0.85
slineFunction · 0.85
RegTopMethod · 0.80
RegisterLocalVarMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…