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

Function multiline

cmd/glua/glua.go:163–178  ·  view source on GitHub ↗
(ml string, rl *readline.Instance, L *lua.LState)

Source from the content-addressed store, hash-verified

161}
162
163func multiline(ml string, rl *readline.Instance, L *lua.LState) (string, error) {
164 for {
165 if _, err := L.LoadString(ml); err == nil { // try compile
166 return ml, nil
167 } else if !incomplete(err) { // syntax error , but not EOF
168 return ml, nil
169 } else {
170 rl.SetPrompt(">> ")
171 if line, err := rl.Readline(); err == nil {
172 ml = ml + "\n" + line
173 } else {
174 return "", err
175 }
176 }
177 }
178}

Callers 1

loadlineFunction · 0.85

Calls 2

incompleteFunction · 0.85
LoadStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…