Add LuaDefineAlias

This commit is contained in:
2023-04-14 14:52:44 -04:00
parent 8ea6c47e4c
commit 47c868876a
4 changed files with 53 additions and 41 deletions

View File

@@ -320,25 +320,9 @@ LuaDefine(string_print, "obj",
"|Concise print the specified object into a string"
"|"
"|This prints a concise representation of obj into a string. Tables"
"|are not expanded: for that, use string.pprintx. The functions"
"|tostring and string.print are identical."
"|") {
LuaArg val;
LuaRet result;
LuaDefStack LS(L, val, result);
eng::ostringstream oss;
atomic_print(LS, val, false, &oss);
LS.set(result, oss.str());
return LS.result();
}
LuaDefine(tostring, "obj",
"|Concise print the specified object into a string"
"|are not expanded: for that, use string.pprint or string.pprintx."
"|"
"|This prints a concise representation of obj into a string. Tables"
"|are not expanded: for that, use string.pprint. The functions"
"|tostring and string.print are identical."
"|The functions string.print and tostring are identical."
"|") {
LuaArg val;
LuaRet result;
@@ -349,6 +333,8 @@ LuaDefine(tostring, "obj",
return LS.result();
}
LuaDefineAlias(tostring, string_print);
LuaDefine(string_isidentifier, "str", "return true if the string is a valid lua identifier") {
LuaArg str;
LuaRet result;