MCPcopy Create free account
hub / github.com/F-Stack/f-stack / trydecpoint

Function trydecpoint

app/redis-6.2.6/deps/lua/src/llex.c:180–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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