MCPcopy Create free account
hub / github.com/defold/defold / read_numeral

Function read_numeral

engine/lua/src/lua/llex.c:200–213  ·  view source on GitHub ↗

LUA_NUMBER */

Source from the content-addressed store, hash-verified

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

Callers 1

llexFunction · 0.85

Calls 5

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

Tested by

no test coverage detected