MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / l_strton

Function l_strton

third-party/lua-5.4.6/src/lvm.c:90–98  ·  view source on GitHub ↗

** Try to convert a value from string to a number value. ** If the value is not a string or is a string not representing ** a valid numeral (or if coercions from strings to numbers ** are disabled via macro 'cvt2num'), do not modify 'result' ** and return 0. */

Source from the content-addressed store, hash-verified

88** and return 0.
89*/
90static int l_strton (const TValue *obj, TValue *result) {
91 lua_assert(obj != result);
92 if (!cvt2num(obj)) /* is object not a string? */
93 return 0;
94 else {
95 TString *st = tsvalue(obj);
96 return (luaO_str2num(getstr(st), result) == tsslen(st) + 1);
97 }
98}
99
100
101/*

Callers 2

luaV_tonumber_Function · 0.70
luaV_tointegerFunction · 0.70

Calls 1

luaO_str2numFunction · 0.70

Tested by

no test coverage detected