summaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-11 10:27:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-11 10:27:32 -0300
commit6ffcf2136788b032bdc0f8520b1bbc2a4d2ea76e (patch)
treeb411d35241864a0ab14d8077ab3fc1f833e01025 /llex.c
parent6427c61e7c3e6acd467b488c573ac37b0f46d0a2 (diff)
downloadlua-6ffcf2136788b032bdc0f8520b1bbc2a4d2ea76e.tar.gz
lua-6ffcf2136788b032bdc0f8520b1bbc2a4d2ea76e.tar.bz2
lua-6ffcf2136788b032bdc0f8520b1bbc2a4d2ea76e.zip
ctype 'lalpha' includes '_' (as '_' behaves as a letter from the
point of view of Lua)
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/llex.c b/llex.c
index 19a8950c..9273260c 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 2.30 2009/02/11 18:25:20 roberto Exp roberto $ 2** $Id: llex.c,v 2.31 2009/02/19 17:18:25 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*/
@@ -206,7 +206,7 @@ static void read_numeral (LexState *ls, SemInfo *seminfo) {
206 } while (lisdigit(ls->current) || ls->current == '.'); 206 } while (lisdigit(ls->current) || ls->current == '.');
207 if (check_next(ls, "Ee")) /* `E'? */ 207 if (check_next(ls, "Ee")) /* `E'? */
208 check_next(ls, "+-"); /* optional exponent sign */ 208 check_next(ls, "+-"); /* optional exponent sign */
209 while (lisalnum(ls->current) || ls->current == '_') 209 while (lislalnum(ls->current))
210 save_and_next(ls); 210 save_and_next(ls);
211 save(ls, '\0'); 211 save(ls, '\0');
212 buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ 212 buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
@@ -408,12 +408,12 @@ static int llex (LexState *ls, SemInfo *seminfo) {
408 read_numeral(ls, seminfo); 408 read_numeral(ls, seminfo);
409 return TK_NUMBER; 409 return TK_NUMBER;
410 } 410 }
411 else if (lisalpha(ls->current) || ls->current == '_') { 411 else if (lislalpha(ls->current)) {
412 /* identifier or reserved word */ 412 /* identifier or reserved word */
413 TString *ts; 413 TString *ts;
414 do { 414 do {
415 save_and_next(ls); 415 save_and_next(ls);
416 } while (lisalnum(ls->current) || ls->current == '_'); 416 } while (lislalnum(ls->current));
417 ts = luaX_newstring(ls, luaZ_buffer(ls->buff), 417 ts = luaX_newstring(ls, luaZ_buffer(ls->buff),
418 luaZ_bufflen(ls->buff)); 418 luaZ_bufflen(ls->buff));
419 if (ts->tsv.reserved > 0) /* reserved word? */ 419 if (ts->tsv.reserved > 0) /* reserved word? */