MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / trydecpoint

Function trydecpoint

src/Chain/libraries/glua/llex.cpp:230–239  ·  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

228** the one defined in the current locale and check again
229*/
230static void trydecpoint(LexState *ls, TValue *o) {
231 char old = ls->decpoint;
232 ls->decpoint = lua_getlocaledecpoint();
233 buffreplace(ls, old, ls->decpoint); /* try new decimal separator */
234 if (luaO_str2num(luaZ_buffer(ls->buff), o) == 0) {
235 /* format error with correct decimal point: no more options */
236 buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */
237 lexerror(ls, "malformed number", TK_FLT);
238 }
239}
240
241
242/* LUA_NUMBER */

Callers 1

read_numeralFunction · 0.85

Calls 3

buffreplaceFunction · 0.85
luaO_str2numFunction · 0.85
lexerrorFunction · 0.85

Tested by

no test coverage detected