diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-14 12:30:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-14 12:30:29 -0300 |
commit | 64d93e7cf90e7d8f0c589960a1cfe583bce28d64 (patch) | |
tree | 291bf5be93e27599c3a59eee04fe81faf0dc6adc | |
parent | d73c5bcfe79459efafb4d4ede67ece8df9f6ef16 (diff) | |
download | lua-64d93e7cf90e7d8f0c589960a1cfe583bce28d64.tar.gz lua-64d93e7cf90e7d8f0c589960a1cfe583bce28d64.tar.bz2 lua-64d93e7cf90e7d8f0c589960a1cfe583bce28d64.zip |
global variables (in $if) may have '_'.
-rw-r--r-- | lex.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | char *rcs_lex = "$Id: lex.c,v 2.46 1997/04/07 14:48:53 roberto Exp roberto $"; | 1 | char *rcs_lex = "$Id: lex.c,v 3.1 1997/04/12 15:01:49 roberto Exp roberto $"; |
2 | 2 | ||
3 | 3 | ||
4 | #include <ctype.h> | 4 | #include <ctype.h> |
@@ -121,7 +121,7 @@ static int checkcond (char *buff) | |||
121 | return 0; | 121 | return 0; |
122 | else if (strcmp(buff, "1") == 0) | 122 | else if (strcmp(buff, "1") == 0) |
123 | return 1; | 123 | return 1; |
124 | else if (isalpha((unsigned char)buff[0])) | 124 | else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') |
125 | return luaI_globaldefined(buff); | 125 | return luaI_globaldefined(buff); |
126 | else { | 126 | else { |
127 | luaI_auxsynterrbf("invalid $if condition", buff); | 127 | luaI_auxsynterrbf("invalid $if condition", buff); |
@@ -134,7 +134,7 @@ static void readname (char *buff) | |||
134 | { | 134 | { |
135 | int i = 0; | 135 | int i = 0; |
136 | skipspace(); | 136 | skipspace(); |
137 | while (isalnum((unsigned char)current)) { | 137 | while (isalnum((unsigned char)current) || current == '_') { |
138 | if (i >= PRAGMASIZE) { | 138 | if (i >= PRAGMASIZE) { |
139 | buff[PRAGMASIZE] = 0; | 139 | buff[PRAGMASIZE] = 0; |
140 | luaI_auxsynterrbf("pragma too long", buff); | 140 | luaI_auxsynterrbf("pragma too long", buff); |