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 | |
| 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)
| -rw-r--r-- | llex.c | 11 | ||||
| -rw-r--r-- | lobject.h | 3 |
2 files changed, 4 insertions, 10 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 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.43 2010/11/26 14:32:31 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.44 2010/12/06 21:08:36 roberto Exp roberto $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -413,6 +413,7 @@ LUAI_FUNC int luaO_ceillog2 (lu_int32 x); | |||
| 413 | LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2); | 413 | LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2); |
| 414 | LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); | 414 | LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); |
| 415 | LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result); | 415 | LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result); |
| 416 | LUAI_FUNC int luaO_hexavalue (int c); | ||
| 416 | LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, | 417 | LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, |
| 417 | va_list argp); | 418 | va_list argp); |
| 418 | LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); | 419 | LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); |
