aboutsummaryrefslogtreecommitdiff
path: root/src/yue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yue.cpp')
-rw-r--r--src/yue.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/yue.cpp b/src/yue.cpp
index 5679e58..7adde70 100644
--- a/src/yue.cpp
+++ b/src/yue.cpp
@@ -270,15 +270,6 @@ int main(int narg, const char** args) {
270 ; 270 ;
271#ifndef YUE_COMPILER_ONLY 271#ifndef YUE_COMPILER_ONLY
272 if (narg == 1) { 272 if (narg == 1) {
273 lua_State* L = luaL_newstate();
274 openlibs(L);
275 DEFER(lua_close(L));
276 pushYue(L, "insert_loader"sv);
277 if (lua_pcall(L, 0, 0, 0) != 0) {
278 std::cout << lua_tostring(L, -1) << '\n';
279 return 1;
280 }
281 int count = 0;
282 linenoise::SetMultiLine(false); 273 linenoise::SetMultiLine(false);
283 linenoise::SetCompletionCallback([](const char* editBuffer, std::vector<std::string>& completions) { 274 linenoise::SetCompletionCallback([](const char* editBuffer, std::vector<std::string>& completions) {
284 std::string buf = editBuffer; 275 std::string buf = editBuffer;
@@ -326,6 +317,15 @@ int main(int narg, const char** args) {
326 break; 317 break;
327 } 318 }
328 }); 319 });
320 lua_State* L = luaL_newstate();
321 openlibs(L);
322 DEFER(lua_close(L));
323 pushYue(L, "insert_loader"sv);
324 if (lua_pcall(L, 0, 0, 0) != 0) {
325 std::cout << lua_tostring(L, -1) << '\n';
326 return 1;
327 }
328 int count = 0;
329 std::cout << "Yuescript "sv << yue::version << '\n'; 329 std::cout << "Yuescript "sv << yue::version << '\n';
330 while (true) { 330 while (true) {
331 count++; 331 count++;