MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / read_numeral

Function read_numeral

Source/Misc/lua/src/lua.c:6905–6918  ·  view source on GitHub ↗

LUA_NUMBER */

Source from the content-addressed store, hash-verified

6903
6904/* LUA_NUMBER */
6905static void read_numeral (LexState *ls, SemInfo *seminfo) {
6906lua_assert(isdigit(ls->current));
6907do {
6908save_and_next(ls);
6909} while (isdigit(ls->current) || ls->current == '.');
6910if (check_next(ls, "Ee")) /* `E'? */
6911check_next(ls, "+-"); /* optional exponent sign */
6912while (isalnum(ls->current) || ls->current == '_')
6913save_and_next(ls);
6914save(ls, '\0');
6915buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
6916if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */
6917trydecpoint(ls, seminfo); /* try to update decimal point separator */
6918}
6919
6920
6921static int skip_sep (LexState *ls) {

Callers 1

llexFunction · 0.85

Calls 5

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

Tested by

no test coverage detected