diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-13 12:39:04 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-13 12:39:04 -0200 |
commit | e4645c835d2b2e49f0d39eb3069638f60da388cd (patch) | |
tree | 6e87114792a20333667fa2bebf37b2ed812890dd | |
parent | 0c5ac77c9949ecfe83537ebe2de355a5286ce6ae (diff) | |
download | lua-e4645c835d2b2e49f0d39eb3069638f60da388cd.tar.gz lua-e4645c835d2b2e49f0d39eb3069638f60da388cd.tar.bz2 lua-e4645c835d2b2e49f0d39eb3069638f60da388cd.zip |
small changes in 'ugly' part.
-rw-r--r-- | lex.c | 29 | ||||
-rw-r--r-- | ugly.h | 16 |
2 files changed, 26 insertions, 19 deletions
@@ -1,4 +1,4 @@ | |||
1 | char *rcs_lex = "$Id: lex.c,v 2.8 1994/10/18 17:34:34 celes Exp roberto $"; | 1 | char *rcs_lex = "$Id: lex.c,v 2.9 1994/11/03 17:09:20 roberto Exp roberto $"; |
2 | 2 | ||
3 | 3 | ||
4 | #include <ctype.h> | 4 | #include <ctype.h> |
@@ -246,22 +246,17 @@ fraction: | |||
246 | yylval.vFloat = a; | 246 | yylval.vFloat = a; |
247 | return NUMBER; | 247 | return NUMBER; |
248 | } | 248 | } |
249 | case U_and: next(); return AND; | 249 | |
250 | case U_do: next(); return DO; | 250 | case U_and: case U_do: case U_else: case U_elseif: case U_end: |
251 | case U_else: next(); return ELSE; | 251 | case U_function: case U_if: case U_local: case U_nil: case U_not: |
252 | case U_elseif: next(); return ELSEIF; | 252 | case U_or: case U_repeat: case U_return: case U_then: |
253 | case U_end: next(); return END; | 253 | case U_until: case U_while: |
254 | case U_function: next(); return FUNCTION; | 254 | { |
255 | case U_if: next(); return IF; | 255 | int old = current; |
256 | case U_local: next(); return LOCAL; | 256 | next(); |
257 | case U_nil: next(); return NIL; | 257 | return reserved[old-U_and].token; |
258 | case U_not: next(); return NOT; | 258 | } |
259 | case U_or: next(); return OR; | 259 | |
260 | case U_repeat: next(); return REPEAT; | ||
261 | case U_return: next(); return RETURN; | ||
262 | case U_then: next(); return THEN; | ||
263 | case U_until: next(); return UNTIL; | ||
264 | case U_while: next(); return WHILE; | ||
265 | case U_eq: next(); return EQ; | 260 | case U_eq: next(); return EQ; |
266 | case U_le: next(); return LE; | 261 | case U_le: next(); return LE; |
267 | case U_ge: next(); return GE; | 262 | case U_ge: next(); return GE; |
@@ -1,5 +1,15 @@ | |||
1 | enum | 1 | /* |
2 | { | 2 | ** ugly.h |
3 | ** TecCGraf - PUC-Rio | ||
4 | ** $Id: $ | ||
5 | */ | ||
6 | |||
7 | #ifndef ugly_h | ||
8 | #define ugly_h | ||
9 | |||
10 | /* This enum must have the same order of the array 'reserved' in lex.c */ | ||
11 | |||
12 | enum { | ||
3 | U_and=128, | 13 | U_and=128, |
4 | U_do, | 14 | U_do, |
5 | U_else, | 15 | U_else, |
@@ -22,3 +32,5 @@ enum | |||
22 | U_ne = '~'+128, | 32 | U_ne = '~'+128, |
23 | U_sc = '.'+128 | 33 | U_sc = '.'+128 |
24 | }; | 34 | }; |
35 | |||
36 | #endif | ||