summaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-09-13 18:49:58 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-09-13 18:49:58 -0300
commitb22356e5c5d836f72e850b5d279ea4af20b8d33c (patch)
tree1ae2b7a066f5b0f78269841033b8f97d18143a7e /llex.c
parenta289a62717219810cf3ebb28c513af671aecfeac (diff)
downloadlua-b22356e5c5d836f72e850b5d279ea4af20b8d33c.tar.gz
lua-b22356e5c5d836f72e850b5d279ea4af20b8d33c.tar.bz2
lua-b22356e5c5d836f72e850b5d279ea4af20b8d33c.zip
hexadecimal constants may be floating values too
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/llex.c b/llex.c
index 83ce856e..5e6aaf6f 100644
--- a/llex.c
+++ b/llex.c
@@ -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? */