** in case of format error, try to change decimal point separator to ** the one defined in the current locale and check again */
| 228 | ** the one defined in the current locale and check again |
| 229 | */ |
| 230 | static void trydecpoint(LexState *ls, TValue *o) { |
| 231 | char old = ls->decpoint; |
| 232 | ls->decpoint = lua_getlocaledecpoint(); |
| 233 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ |
| 234 | if (luaO_str2num(luaZ_buffer(ls->buff), o) == 0) { |
| 235 | /* format error with correct decimal point: no more options */ |
| 236 | buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ |
| 237 | lexerror(ls, "malformed number", TK_FLT); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | |
| 242 | /* LUA_NUMBER */ |
no test coverage detected