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

Function read_numeral

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

LUA_NUMBER */

Source from the content-addressed store, hash-verified

193
194/* LUA_NUMBER */
195static void read_numeral (LexState *ls, SemInfo *seminfo) {
196 lua_assert(isdigit(ls->current));
197 do {
198 save_and_next(ls);
199 } while (isdigit(ls->current) || ls->current == '.');
200 if (check_next(ls, "Ee")) /* `E'? */
201 check_next(ls, "+-"); /* optional exponent sign */
202 while (isalnum(ls->current) || ls->current == '_')
203 save_and_next(ls);
204 save(ls, '\0');
205 buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
206 if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */
207 trydecpoint(ls, seminfo); /* try to update decimal point separator */
208}
209
210
211static size_t skip_sep (LexState *ls) {

Callers 1

llexFunction · 0.70

Calls 6

isdigitFunction · 0.85
check_nextFunction · 0.70
saveFunction · 0.70
buffreplaceFunction · 0.70
luaO_str2dFunction · 0.70
trydecpointFunction · 0.70

Tested by

no test coverage detected