diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-14 16:11:09 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-14 16:11:09 -0300 |
commit | 15c17c24facb6d7e6f837b87927a54a40a54aa36 (patch) | |
tree | 4d0f1d0c49133ea06223627e1abd247c0ad78b6b /lex.c | |
parent | 45cf24485de6738b44cd9a68738ae6a11b3827db (diff) | |
download | lua-15c17c24facb6d7e6f837b87927a54a40a54aa36.tar.gz lua-15c17c24facb6d7e6f837b87927a54a40a54aa36.tar.bz2 lua-15c17c24facb6d7e6f837b87927a54a40a54aa36.zip |
small improvements
Diffstat (limited to 'lex.c')
-rw-r--r-- | lex.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | char *rcs_lex = "$Id: lex.c,v 2.26 1996/02/13 17:30:39 roberto Exp roberto $"; | 1 | char *rcs_lex = "$Id: lex.c,v 2.27 1996/02/14 13:35:51 roberto Exp roberto $"; |
2 | 2 | ||
3 | 3 | ||
4 | #include <ctype.h> | 4 | #include <ctype.h> |
@@ -16,8 +16,6 @@ char *rcs_lex = "$Id: lex.c,v 2.26 1996/02/13 17:30:39 roberto Exp roberto $"; | |||
16 | 16 | ||
17 | #define MINBUFF 260 | 17 | #define MINBUFF 260 |
18 | 18 | ||
19 | #define lua_strcmp(a,b) (a[0]<b[0]?(-1):(a[0]>b[0]?(1):strcmp(a,b))) | ||
20 | |||
21 | #define next() { current = input(); } | 19 | #define next() { current = input(); } |
22 | #define save(x) { *yytextLast++ = (x); } | 20 | #define save(x) { *yytextLast++ = (x); } |
23 | #define save_and_next() { save(current); next(); } | 21 | #define save_and_next() { save(current); next(); } |
@@ -165,12 +163,12 @@ int luaY_lex (void) | |||
165 | while (isalnum(current) || current == '_') | 163 | while (isalnum(current) || current == '_') |
166 | save_and_next(); | 164 | save_and_next(); |
167 | *yytextLast = 0; | 165 | *yytextLast = 0; |
168 | if (lua_strcmp(yytext, "debug") == 0) | 166 | if (strcmp(yytext, "debug") == 0) |
169 | { | 167 | { |
170 | luaY_lval.vInt = 1; | 168 | luaY_lval.vInt = 1; |
171 | return DEBUG; | 169 | return DEBUG; |
172 | } | 170 | } |
173 | else if (lua_strcmp(yytext, "nodebug") == 0) | 171 | else if (strcmp(yytext, "nodebug") == 0) |
174 | { | 172 | { |
175 | luaY_lval.vInt = 0; | 173 | luaY_lval.vInt = 0; |
176 | return DEBUG; | 174 | return DEBUG; |