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

Function doREPL

cmd/glua/glua.go:123–139  ·  view source on GitHub ↗

do read/eval/print/loop

(L *lua.LState)

Source from the content-addressed store, hash-verified

121
122// do read/eval/print/loop
123func doREPL(L *lua.LState) {
124 rl, err := readline.New("> ")
125 if err != nil {
126 panic(err)
127 }
128 defer rl.Close()
129 for {
130 if str, err := loadline(rl, L); err == nil {
131 if err := L.DoString(str); err != nil {
132 fmt.Println(err)
133 }
134 } else { // error on loadline
135 fmt.Println(err)
136 return
137 }
138 }
139}
140
141func incomplete(err error) bool {
142 if lerr, ok := err.(*lua.ApiError); ok {

Callers 1

mainAuxFunction · 0.85

Calls 3

loadlineFunction · 0.85
DoStringMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…