** in case of format error, try to change decimal point separator to ** the one defined in the current locale and check again */
| 213 | ** the one defined in the current locale and check again |
| 214 | */ |
| 215 | static void trydecpoint (LexState *ls, SemInfo *seminfo) { |
| 216 | char old = ls->decpoint; |
| 217 | ls->decpoint = getlocaledecpoint(); |
| 218 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ |
| 219 | if (!buff2d(ls->buff, &seminfo->r)) { |
| 220 | /* format error with correct decimal point: no more options */ |
| 221 | buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ |
| 222 | lexerror(ls, "malformed number", TK_NUMBER); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | |
| 227 | /* LUA_NUMBER */ |
no test coverage detected