diff options
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/state.cpp b/src/state.cpp index 6fabc5f..b558d11 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -99,9 +99,9 @@ namespace { | |||
99 | DEBUGSPEW_CODE(DebugSpew(Universe::Get(L_)) << "opening '" << _name << "' library" << std::endl); | 99 | DEBUGSPEW_CODE(DebugSpew(Universe::Get(L_)) << "opening '" << _name << "' library" << std::endl); |
100 | STACK_CHECK_START_REL(L_, 0); | 100 | STACK_CHECK_START_REL(L_, 0); |
101 | // open the library as if through require(), and create a global as well if necessary (the library table is left on the stack) | 101 | // open the library as if through require(), and create a global as well if necessary (the library table is left on the stack) |
102 | bool const _isLanesCore{ _libfunc == luaopen_lanes_core }; // don't want to create a global for "lanes.core" | 102 | bool const _isLanesCore{ _libfunc == luaopen_lanes_core }; // don't want to create a global for "lanes_core" |
103 | luaL_requiref(L_, _name.data(), _libfunc, !_isLanesCore); // L_: {lib} | 103 | luaL_requiref(L_, _name.data(), _libfunc, !_isLanesCore); // L_: {lib} |
104 | // lanes.core doesn't declare a global, so scan it here and now | 104 | // lanes_core doesn't declare a global, so scan it here and now |
105 | if (_isLanesCore) { | 105 | if (_isLanesCore) { |
106 | tools::PopulateFuncLookupTable(L_, kIdxTop, _name); | 106 | tools::PopulateFuncLookupTable(L_, kIdxTop, _name); |
107 | } | 107 | } |
@@ -224,7 +224,7 @@ namespace state { | |||
224 | if (_libs == "*") { | 224 | if (_libs == "*") { |
225 | DEBUGSPEW_CODE(DebugSpew(U_) << "opening ALL standard libraries" << std::endl); | 225 | DEBUGSPEW_CODE(DebugSpew(U_) << "opening ALL standard libraries" << std::endl); |
226 | luaL_openlibs(_L); | 226 | luaL_openlibs(_L); |
227 | // don't forget lanes.core for regular lane states | 227 | // don't forget lanes_core for regular lane states |
228 | Open1Lib(_L, kLanesCoreLibName); | 228 | Open1Lib(_L, kLanesCoreLibName); |
229 | _libs = ""; // done with libs | 229 | _libs = ""; // done with libs |
230 | } else { | 230 | } else { |
@@ -248,7 +248,6 @@ namespace state { | |||
248 | 248 | ||
249 | // scan all libraries, open them one by one | 249 | // scan all libraries, open them one by one |
250 | auto isLibNameChar = [](char const c_) { | 250 | auto isLibNameChar = [](char const c_) { |
251 | // '.' can be part of name for "lanes.core" | ||
252 | return std::isalnum(c_) || c_ == '.' || c_ == '-' || c_ == '_'; | 251 | return std::isalnum(c_) || c_ == '.' || c_ == '-' || c_ == '_'; |
253 | }; | 252 | }; |
254 | while (!_libs.empty()) { | 253 | while (!_libs.empty()) { |