82 end |
82 end |
83 end |
83 end |
84 |
84 |
85 session.env._ = data; |
85 session.env._ = data; |
86 |
86 |
87 local chunk, err = loadstring("return "..data); |
87 local chunkname = "=console"; |
|
88 local chunk, err = loadstring("return "..data, chunkname); |
88 if not chunk then |
89 if not chunk then |
89 chunk, err = loadstring(data); |
90 chunk, err = loadstring(data, chunkname); |
90 if not chunk then |
91 if not chunk then |
91 err = err:gsub("^%[string .-%]:%d+: ", ""); |
92 err = err:gsub("^%[string .-%]:%d+: ", ""); |
92 err = err:gsub("^:%d+: ", ""); |
93 err = err:gsub("^:%d+: ", ""); |
93 err = err:gsub("'<eof>'", "the end of the line"); |
94 err = err:gsub("'<eof>'", "the end of the line"); |
94 session.print("Sorry, I couldn't understand that... "..err); |
95 session.print("Sorry, I couldn't understand that... "..err); |