More refactors to prepare for doc-search, including moving unicode support into ext.

This commit is contained in:
2026-01-14 12:30:44 -05:00
parent 4e374294b6
commit 850b4aa43b
10 changed files with 334 additions and 254 deletions

View File

@@ -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)) {