From 64d93e7cf90e7d8f0c589960a1cfe583bce28d64 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 14 Apr 1997 12:30:29 -0300 Subject: [PATCH] global variables (in $if) may have '_'. --- lex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lex.c b/lex.c index 8740f1e2..96d2d93f 100644 --- 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 @@ -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);