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

Method Load

state.go:2013–2023  ·  view source on GitHub ↗

* }}} */ * load and function call operations {{{ */

(reader io.Reader, name string)

Source from the content-addressed store, hash-verified

2011/* load and function call operations {{{ */
2012
2013func (ls *LState) Load(reader io.Reader, name string) (*LFunction, error) {
2014 chunk, err := parse.Parse(reader, name)
2015 if err != nil {
2016 return nil, newApiErrorE(ApiErrorSyntax, err)
2017 }
2018 proto, err := Compile(chunk, name)
2019 if err != nil {
2020 return nil, newApiErrorE(ApiErrorSyntax, err)
2021 }
2022 return newLFunctionL(proto, ls.currentEnv(), 0), nil
2023}
2024
2025func (ls *LState) Call(nargs, nret int) {
2026 ls.callR(nargs, nret, -1)

Callers 3

LoadFileMethod · 0.95
LoadStringMethod · 0.95
loadauxFunction · 0.45

Calls 5

currentEnvMethod · 0.95
ParseFunction · 0.92
CompileFunction · 0.85
newLFunctionLFunction · 0.85
newApiErrorEFunction · 0.70

Tested by

no test coverage detected