Work on SourceDB:rebuild

This commit is contained in:
2023-04-10 17:58:44 -04:00
parent 005ce0629e
commit 972f0095c6
5 changed files with 94 additions and 60 deletions

View File

@@ -141,17 +141,33 @@ public:
//
void update(const util::LuaSourceVec &source);
// Rebuild
// modules
//
// Rebuild the lua environment: clear it out, then reinstall all the
// functions that should be there. See above for more information.
// Returns a list of all the modules. The first item in the list
// is always the string "CORE" which represents the lua core
// functionality with all the builtins. This is then followed by
// all the lua sourcefiles in the correct order.
//
// Any error messages will be collected into a single long string
// containing one error per line, and returned. If the return value
// is the empty string, there were no errors.
//
eng::string rebuild();
eng::vector<eng::string> modules();
// rebuild_module
//
// To rebuild the lua environment, fetch the module list, then
// call rebuild_module on each module in turn. This will return
// an error message for the module, or empty string if no error.
//
// This is a thin wrapper around traceback_pcall. The return
// value is the return value of traceback_pcall.
//
eng::string rebuild_module(const eng::string &mod);
// rebuild_core
//
// This is equivalent to rebuild_module("CORE"). Clears the environment
// and installs all the builtins. No error conditions.
//
void rebuild_core();
// Difference transmission.
//
// Note: The patch routine applies the differences to the source