MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / trydecpoint

Function trydecpoint

third-party/lua-5.1.5/src/llex.c:179–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179static void trydecpoint (LexState *ls, SemInfo *seminfo) {
180 /* format error: try to update decimal point separator */
181 struct lconv *cv = localeconv();
182 char old = ls->decpoint;
183 ls->decpoint = (cv ? cv->decimal_point[0] : '.');
184 buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
185 if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
186 /* format error with correct decimal point: no more options */
187 buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */
188 luaX_lexerror(ls, "malformed number", TK_NUMBER);
189 }
190}
191
192
193/* LUA_NUMBER */

Callers 1

read_numeralFunction · 0.70

Calls 3

luaX_lexerrorFunction · 0.85
buffreplaceFunction · 0.70
luaO_str2dFunction · 0.70

Tested by

no test coverage detected