diff options
| -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); |
