Major string_view refactor. Added namespace sv

This commit is contained in:
2022-04-16 02:26:32 -04:00
parent b6d603034e
commit d2c81e640d
13 changed files with 381 additions and 309 deletions

View File

@@ -197,7 +197,7 @@ static void pprint_r(Inspector &insp, int level, LuaSlot root) {
} else {
multiline = true;
tabify(insp, level + 1);
if (LS.isstring(key) && util::is_identifier(LS.ckstring(key))) {
if (LS.isstring(key) && sv::is_lua_id(LS.ckstring(key))) {
(*insp.stream) << LS.ckstring(key);
} else {
(*insp.stream) << "[";
@@ -254,7 +254,7 @@ LuaDefine(string_isidentifier, "str", "return true if the string is a valid lua
LuaStack LS(L, str, result);
if (LS.isstring(str)) {
eng::string s = LS.ckstring(str);
LS.set(result, util::is_identifier(s));
LS.set(result, sv::is_lua_id(s));
} else {
LS.set(result, false);
}