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

Function trydecpoint

freebsd/contrib/openzfs/module/lua/llex.c:212–221  ·  view source on GitHub ↗

** in case of format error, try to change decimal point separator to ** the one defined in the current locale and check again */

Source from the content-addressed store, hash-verified

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

Callers 1

read_numeralFunction · 0.70

Calls 2

lexerrorFunction · 0.85
buffreplaceFunction · 0.70

Tested by

no test coverage detected