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

Function read_numeral

third-party/lua-5.1.5/src/llex.c:194–207  ·  view source on GitHub ↗

LUA_NUMBER */

Source from the content-addressed store, hash-verified

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

Callers 1

llexFunction · 0.70

Calls 5

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

Tested by

no test coverage detected