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

Method Load

_state.go:1800–1810  ·  view source on GitHub ↗

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

(reader io.Reader, name string)

Source from the content-addressed store, hash-verified

1798/* load and function call operations {{{ */
1799
1800func (ls *LState) Load(reader io.Reader, name string) (*LFunction, error) {
1801 chunk, err := parse.Parse(reader, name)
1802 if err != nil {
1803 return nil, newApiErrorE(ApiErrorSyntax, err)
1804 }
1805 proto, err := Compile(chunk, name)
1806 if err != nil {
1807 return nil, newApiErrorE(ApiErrorSyntax, err)
1808 }
1809 return newLFunctionL(proto, ls.currentEnv(), 0), nil
1810}
1811
1812func (ls *LState) Call(nargs, nret int) {
1813 ls.callR(nargs, nret, -1)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected