lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 64d93e7cf90e7d8f0c589960a1cfe583bce28d64
parent d73c5bcfe79459efafb4d4ede67ece8df9f6ef16
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 14 Apr 1997 12:30:09 -0300

global variables (in $if) may have '_'.

Diffstat:
Mlex.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lex.c b/lex.c @@ -1,4 +1,4 @@ -char *rcs_lex = "$Id: lex.c,v 2.46 1997/04/07 14:48:53 roberto Exp roberto $"; +char *rcs_lex = "$Id: lex.c,v 3.1 1997/04/12 15:01:49 roberto Exp roberto $"; #include <ctype.h> @@ -121,7 +121,7 @@ static int checkcond (char *buff) return 0; else if (strcmp(buff, "1") == 0) return 1; - else if (isalpha((unsigned char)buff[0])) + else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') return luaI_globaldefined(buff); else { luaI_auxsynterrbf("invalid $if condition", buff); @@ -134,7 +134,7 @@ static void readname (char *buff) { int i = 0; skipspace(); - while (isalnum((unsigned char)current)) { + while (isalnum((unsigned char)current) || current == '_') { if (i >= PRAGMASIZE) { buff[PRAGMASIZE] = 0; luaI_auxsynterrbf("pragma too long", buff);