From 6ffcf2136788b032bdc0f8520b1bbc2a4d2ea76e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Mar 2009 10:27:32 -0300 Subject: ctype 'lalpha' includes '_' (as '_' behaves as a letter from the point of view of Lua) --- llex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 19a8950c..9273260c 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.30 2009/02/11 18:25:20 roberto Exp roberto $ +** $Id: llex.c,v 2.31 2009/02/19 17:18:25 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -206,7 +206,7 @@ static void read_numeral (LexState *ls, SemInfo *seminfo) { } while (lisdigit(ls->current) || ls->current == '.'); if (check_next(ls, "Ee")) /* `E'? */ check_next(ls, "+-"); /* optional exponent sign */ - while (lisalnum(ls->current) || ls->current == '_') + while (lislalnum(ls->current)) save_and_next(ls); save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ @@ -408,12 +408,12 @@ static int llex (LexState *ls, SemInfo *seminfo) { read_numeral(ls, seminfo); return TK_NUMBER; } - else if (lisalpha(ls->current) || ls->current == '_') { + else if (lislalpha(ls->current)) { /* identifier or reserved word */ TString *ts; do { save_and_next(ls); - } while (lisalnum(ls->current) || ls->current == '_'); + } while (lislalnum(ls->current)); ts = luaX_newstring(ls, luaZ_buffer(ls->buff), luaZ_bufflen(ls->buff)); if (ts->tsv.reserved > 0) /* reserved word? */ -- cgit v1.2.3-55-g6feb