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

Function luaO_str2num

third-party/lua-5.4.6/src/lobject.c:308–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306
307
308size_t luaO_str2num (const char *s, TValue *o) {
309 lua_Integer i; lua_Number n;
310 const char *e;
311 if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */
312 setivalue(o, i);
313 }
314 else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */
315 setfltvalue(o, n);
316 }
317 else
318 return 0; /* conversion failed */
319 return (e - s) + 1; /* success; return string size */
320}
321
322
323int luaO_utf8esc (char *buff, unsigned long x) {

Callers 3

l_strtonFunction · 0.70
read_numeralFunction · 0.70
lua_stringtonumberFunction · 0.70

Calls 2

l_str2intFunction · 0.70
l_str2dFunction · 0.70

Tested by

no test coverage detected