diff options
| -rw-r--r-- | llex.c | 10 |
1 files changed, 4 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 2.37 2010/04/16 12:31:07 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.38 2010/09/07 19:21:39 roberto Exp roberto $ |
| 3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -221,11 +221,9 @@ static void read_numeral (LexState *ls, SemInfo *seminfo) { | |||
| 221 | lua_assert(lisdigit(ls->current)); | 221 | lua_assert(lisdigit(ls->current)); |
| 222 | do { | 222 | do { |
| 223 | save_and_next(ls); | 223 | save_and_next(ls); |
| 224 | } while (lisdigit(ls->current) || ls->current == '.'); | 224 | if (check_next(ls, "EePp")) /* exponent part? */ |
| 225 | if (check_next(ls, "Ee")) /* `E'? */ | 225 | check_next(ls, "+-"); /* optional exponent sign */ |
| 226 | check_next(ls, "+-"); /* optional exponent sign */ | 226 | } while (lislalnum(ls->current) || ls->current == '.'); |
| 227 | while (lislalnum(ls->current)) | ||
| 228 | save_and_next(ls); | ||
| 229 | save(ls, '\0'); | 227 | save(ls, '\0'); |
| 230 | buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ | 228 | buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ |
| 231 | if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ | 229 | if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ |
