MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / trydecpoint

Function trydecpoint

Source/Misc/lua/src/lua.c:6890–6901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6888
6889
6890static void trydecpoint (LexState *ls, SemInfo *seminfo) {
6891/* format error: try to update decimal point separator */
6892struct lconv *cv = localeconv();
6893char old = ls->decpoint;
6894ls->decpoint = (cv ? cv->decimal_point[0] : '.');
6895buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
6896if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
6897/* format error with correct decimal point: no more options */
6898buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */
6899luaX_lexerror(ls, "malformed number", TK_NUMBER);
6900}
6901}
6902
6903
6904/* LUA_NUMBER */

Callers 1

read_numeralFunction · 0.85

Calls 3

buffreplaceFunction · 0.85
luaO_str2dFunction · 0.85
luaX_lexerrorFunction · 0.85

Tested by

no test coverage detected