08-15-2017, 03:52 AM
If there's no match, it doesn't return; it raises a Lua error instead, which basically throws an exception that is caught by the code that called into Lua and prints the plugin error message. Internally, it uses cLuaState::ApiParamError() to do all that.
In the long run, I'd like to get rid of the ToLua++ parser and replace it with bindings description (something like APIDesc is now), from which a Lua script would generate the C++ bindings and the documentation simultaneously. And the CuberitePluginChecker could use it to simulate plugins, too. That way, we'd have guaranteed documentation for all API symbols, less manual exports and we'll get rid of the hacks we currently need in order for ToLua++ to parse the code.
In the long run, I'd like to get rid of the ToLua++ parser and replace it with bindings description (something like APIDesc is now), from which a Lua script would generate the C++ bindings and the documentation simultaneously. And the CuberitePluginChecker could use it to simulate plugins, too. That way, we'd have guaranteed documentation for all API symbols, less manual exports and we'll get rid of the hacks we currently need in order for ToLua++ to parse the code.