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

Function trydecpoint

third-party/lua-5.2.4/src/llex.c:215–224  ·  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

213** the one defined in the current locale and check again
214*/
215static 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 */

Callers 1

read_numeralFunction · 0.70

Calls 2

buffreplaceFunction · 0.70
lexerrorFunction · 0.70

Tested by

no test coverage detected