2022-01-28 07:46:05 +08:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lua.h"
|
|
|
|
|
2022-02-12 03:02:09 +08:00
|
|
|
#include <functional>
|
2022-01-28 07:46:05 +08:00
|
|
|
#include <string>
|
|
|
|
|
2022-02-12 03:02:09 +08:00
|
|
|
using AddCompletionCallback = std::function<void(const std::string& completion, const std::string& display)>;
|
|
|
|
|
2022-01-28 07:46:05 +08:00
|
|
|
// Note: These are internal functions which are being exposed in a header
|
|
|
|
// so they can be included by unit tests.
|
|
|
|
void setupState(lua_State* L);
|
|
|
|
std::string runCode(lua_State* L, const std::string& source);
|
2022-02-12 03:02:09 +08:00
|
|
|
void getCompletions(lua_State* L, const std::string& editBuffer, const AddCompletionCallback& addCompletionCallback);
|
|
|
|
|
|
|
|
int replMain(int argc, char** argv);
|