diff options
| -rw-r--r-- | lex.c | 31 |
1 files changed, 7 insertions, 24 deletions
| @@ -1,5 +1,9 @@ | |||
| 1 | char *rcs_lex = "$Id: lex.c,v 2.6 1994/09/26 16:21:52 celes Exp celes $"; | 1 | char *rcs_lex = "$Id: lex.c,v 2.7 1994/10/17 19:01:53 celes Exp celes $"; |
| 2 | /*$Log: lex.c,v $ | 2 | /*$Log: lex.c,v $ |
| 3 | * Revision 2.7 1994/10/17 19:01:53 celes | ||
| 4 | * new algorithm for reading floats. | ||
| 5 | * files end with EOF, instead of 0. | ||
| 6 | * | ||
| 3 | * Revision 2.6 1994/09/26 16:21:52 celes | 7 | * Revision 2.6 1994/09/26 16:21:52 celes |
| 4 | * Mudancas para tornar lex.c um modulo independente dos outros | 8 | * Mudancas para tornar lex.c um modulo independente dos outros |
| 5 | * modulos de Lua | 9 | * modulos de Lua |
| @@ -41,6 +45,7 @@ char *rcs_lex = "$Id: lex.c,v 2.6 1994/09/26 16:21:52 celes Exp celes $"; | |||
| 41 | #include "opcode.h" | 45 | #include "opcode.h" |
| 42 | #include "inout.h" | 46 | #include "inout.h" |
| 43 | #include "y.tab.h" | 47 | #include "y.tab.h" |
| 48 | #include "ugly.h" | ||
| 44 | 49 | ||
| 45 | #define lua_strcmp(a,b) (a[0]<b[0]?(-1):(a[0]>b[0]?(1):strcmp(a,b))) | 50 | #define lua_strcmp(a,b) (a[0]<b[0]?(-1):(a[0]>b[0]?(1):strcmp(a,b))) |
| 46 | 51 | ||
| @@ -91,29 +96,6 @@ static struct | |||
| 91 | {"until", UNTIL}, | 96 | {"until", UNTIL}, |
| 92 | {"while", WHILE} }; | 97 | {"while", WHILE} }; |
| 93 | 98 | ||
| 94 | enum | ||
| 95 | { | ||
| 96 | U_and=128, | ||
| 97 | U_do, | ||
| 98 | U_else, | ||
| 99 | U_elseif, | ||
| 100 | U_end, | ||
| 101 | U_function, | ||
| 102 | U_if, | ||
| 103 | U_local, | ||
| 104 | U_nil, | ||
| 105 | U_not, | ||
| 106 | U_or, | ||
| 107 | U_repeat, | ||
| 108 | U_return, | ||
| 109 | U_then, | ||
| 110 | U_until, | ||
| 111 | U_while, | ||
| 112 | U_le = '<'+128, | ||
| 113 | U_ge = '>'+128, | ||
| 114 | U_ne = '~'+128, | ||
| 115 | U_sc = '.'+128 | ||
| 116 | }; | ||
| 117 | 99 | ||
| 118 | #define RESERVEDSIZE (sizeof(reserved)/sizeof(reserved[0])) | 100 | #define RESERVEDSIZE (sizeof(reserved)/sizeof(reserved[0])) |
| 119 | 101 | ||
| @@ -315,6 +297,7 @@ fraction: | |||
| 315 | case U_then: next(); return THEN; | 297 | case U_then: next(); return THEN; |
| 316 | case U_until: next(); return UNTIL; | 298 | case U_until: next(); return UNTIL; |
| 317 | case U_while: next(); return WHILE; | 299 | case U_while: next(); return WHILE; |
| 300 | case U_eq: next(); return EQ; | ||
| 318 | case U_le: next(); return LE; | 301 | case U_le: next(); return LE; |
| 319 | case U_ge: next(); return GE; | 302 | case U_ge: next(); return GE; |
| 320 | case U_ne: next(); return NE; | 303 | case U_ne: next(); return NE; |
