** 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. */
| 98 | ** and return 0. |
| 99 | */ |
| 100 | static int l_strton (const TValue *obj, TValue *result) { |
| 101 | lua_assert(obj != result); |
| 102 | if (!cvt2num(obj)) /* is object not a string? */ |
| 103 | return 0; |
| 104 | else { |
| 105 | TString *st = tsvalue(obj); |
| 106 | return (luaO_str2num(getstr(st), result) == tsslen(st) + 1); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | |
| 111 | /* |
no test coverage detected