More refactors to prepare for doc-search, including moving unicode support into ext.
This commit is contained in:
@@ -545,6 +545,24 @@ void SourceDB::register_lua_builtins() {
|
||||
lua_close(L);
|
||||
}
|
||||
|
||||
|
||||
|
||||
util::StringVec SourceDB::search_docs(const eng::string &substring) {
|
||||
// This map will hold the results. It maps function name
|
||||
// to a documentation line.
|
||||
eng::map<eng::string, eng::string> results;
|
||||
|
||||
// Search the built-in functions.
|
||||
// for (const LuaFunctionReg *reg = LuaFunctionReg::All; reg != nullptr; reg=reg->next()) {
|
||||
// }
|
||||
|
||||
util::StringVec resultvec;
|
||||
for (const auto &pair : results) {
|
||||
resultvec.push_back(pair.second);
|
||||
}
|
||||
return resultvec;
|
||||
}
|
||||
|
||||
eng::string SourceDB::function_docs(const LuaCoreStack &LS, LuaSlot fn) {
|
||||
lua_State *L = LS.state();
|
||||
if (LS.iscfunction(fn)) {
|
||||
|
||||
Reference in New Issue
Block a user