** 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. */
| 88 | ** and return 0. |
| 89 | */ |
| 90 | static 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 | return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1); |
| 96 | } |
| 97 | |
| 98 | |
| 99 | /* |
no test coverage detected