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

Function loadline

cmd/glua/glua.go:150–161  ·  view source on GitHub ↗
(rl *readline.Instance, L *lua.LState)

Source from the content-addressed store, hash-verified

148}
149
150func loadline(rl *readline.Instance, L *lua.LState) (string, error) {
151 rl.SetPrompt("> ")
152 if line, err := rl.Readline(); err == nil {
153 if _, err := L.LoadString("return " + line); err == nil { // try add return <...> then compile
154 return line, nil
155 } else {
156 return multiline(line, rl, L)
157 }
158 } else {
159 return "", err
160 }
161}
162
163func multiline(ml string, rl *readline.Instance, L *lua.LState) (string, error) {
164 for {

Callers 1

doREPLFunction · 0.85

Calls 2

multilineFunction · 0.85
LoadStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…