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

Function luaO_str2num

third-party/lua-5.5.0/src/lobject.c:371–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369
370
371size_t luaO_str2num (const char *s, TValue *o) {
372 lua_Integer i; lua_Number n;
373 const char *e;
374 if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */
375 setivalue(o, i);
376 }
377 else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */
378 setfltvalue(o, n);
379 }
380 else
381 return 0; /* conversion failed */
382 return ct_diff2sz(e - s) + 1; /* success; return string size */
383}
384
385
386int luaO_utf8esc (char *buff, l_uint32 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