From 1aead7f5536c92cfbd1dd7dbb51f5ac95f239e14 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 10 Dec 2010 12:53:15 -0200 Subject: 'hexafloat' moved to 'lobject.c' (hexa conversion needs it too) --- llex.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 5a742cf6..e4bfa48d 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.41 2010/11/18 18:38:44 roberto Exp roberto $ +** $Id: llex.c,v 2.42 2010/12/06 21:08:36 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -286,13 +286,6 @@ static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { } -static int hexavalue (int c) { - if (lisdigit(c)) return c - '0'; - else if (lisupper(c)) return c - 'A' + 10; - else return c - 'a' + 10; -} - - static int readhexaesc (LexState *ls) { int c1, c2 = EOZ; if (!lisxdigit(c1 = next(ls)) || !lisxdigit(c2 = next(ls))) { @@ -302,7 +295,7 @@ static int readhexaesc (LexState *ls) { if (c2 != EOZ) save(ls, c2); lexerror(ls, "hexadecimal digit expected", TK_STRING); } - return (hexavalue(c1) << 4) + hexavalue(c2); + return (luaO_hexavalue(c1) << 4) + luaO_hexavalue(c2); } -- cgit v1.2.3-55-g6feb