diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-10 12:53:15 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-10 12:53:15 -0200 |
commit | 1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14 (patch) | |
tree | 9e63224e38e4f72efb3da3a50771de3d99337d53 /llex.c | |
parent | 75d8470f0f3719594637ddaba4bb9dbbb30e94ec (diff) | |
download | lua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.tar.gz lua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.tar.bz2 lua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.zip |
'hexafloat' moved to 'lobject.c' (hexa conversion needs it too)
Diffstat (limited to '')
-rw-r--r-- | llex.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.41 2010/11/18 18:38:44 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.42 2010/12/06 21:08:36 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 | */ |
@@ -286,13 +286,6 @@ static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { | |||
286 | } | 286 | } |
287 | 287 | ||
288 | 288 | ||
289 | static int hexavalue (int c) { | ||
290 | if (lisdigit(c)) return c - '0'; | ||
291 | else if (lisupper(c)) return c - 'A' + 10; | ||
292 | else return c - 'a' + 10; | ||
293 | } | ||
294 | |||
295 | |||
296 | static int readhexaesc (LexState *ls) { | 289 | static int readhexaesc (LexState *ls) { |
297 | int c1, c2 = EOZ; | 290 | int c1, c2 = EOZ; |
298 | if (!lisxdigit(c1 = next(ls)) || !lisxdigit(c2 = next(ls))) { | 291 | if (!lisxdigit(c1 = next(ls)) || !lisxdigit(c2 = next(ls))) { |
@@ -302,7 +295,7 @@ static int readhexaesc (LexState *ls) { | |||
302 | if (c2 != EOZ) save(ls, c2); | 295 | if (c2 != EOZ) save(ls, c2); |
303 | lexerror(ls, "hexadecimal digit expected", TK_STRING); | 296 | lexerror(ls, "hexadecimal digit expected", TK_STRING); |
304 | } | 297 | } |
305 | return (hexavalue(c1) << 4) + hexavalue(c2); | 298 | return (luaO_hexavalue(c1) << 4) + luaO_hexavalue(c2); |
306 | } | 299 | } |
307 | 300 | ||
308 | 301 | ||