aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-10 12:53:15 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-10 12:53:15 -0200
commit1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14 (patch)
tree9e63224e38e4f72efb3da3a50771de3d99337d53
parent75d8470f0f3719594637ddaba4bb9dbbb30e94ec (diff)
downloadlua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.tar.gz
lua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.tar.bz2
lua-1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14.zip
'hexafloat' moved to 'lobject.c' (hexa conversion needs it too)
-rw-r--r--llex.c11
-rw-r--r--lobject.h3
2 files changed, 4 insertions, 10 deletions
diff --git a/llex.c b/llex.c
index 5a742cf6..e4bfa48d 100644
--- a/llex.c
+++ b/llex.c
@@ -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
289static 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
296static int readhexaesc (LexState *ls) { 289static 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
diff --git a/lobject.h b/lobject.h
index 823b5cd2..864c613d 100644
--- a/lobject.h
+++ b/lobject.h
@@ -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);
413LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2); 413LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2);
414LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); 414LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
415LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result); 415LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result);
416LUAI_FUNC int luaO_hexavalue (int c);
416LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, 417LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
417 va_list argp); 418 va_list argp);
418LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); 419LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);