mirror of https://github.com/rusefi/lua.git
small changes in 'ugly' part.
This commit is contained in:
parent
0c5ac77c99
commit
e4645c835d
29
lex.c
29
lex.c
|
@ -1,4 +1,4 @@
|
||||||
char *rcs_lex = "$Id: lex.c,v 2.8 1994/10/18 17:34:34 celes Exp roberto $";
|
char *rcs_lex = "$Id: lex.c,v 2.9 1994/11/03 17:09:20 roberto Exp roberto $";
|
||||||
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -246,22 +246,17 @@ fraction:
|
||||||
yylval.vFloat = a;
|
yylval.vFloat = a;
|
||||||
return NUMBER;
|
return NUMBER;
|
||||||
}
|
}
|
||||||
case U_and: next(); return AND;
|
|
||||||
case U_do: next(); return DO;
|
case U_and: case U_do: case U_else: case U_elseif: case U_end:
|
||||||
case U_else: next(); return ELSE;
|
case U_function: case U_if: case U_local: case U_nil: case U_not:
|
||||||
case U_elseif: next(); return ELSEIF;
|
case U_or: case U_repeat: case U_return: case U_then:
|
||||||
case U_end: next(); return END;
|
case U_until: case U_while:
|
||||||
case U_function: next(); return FUNCTION;
|
{
|
||||||
case U_if: next(); return IF;
|
int old = current;
|
||||||
case U_local: next(); return LOCAL;
|
next();
|
||||||
case U_nil: next(); return NIL;
|
return reserved[old-U_and].token;
|
||||||
case U_not: next(); return NOT;
|
}
|
||||||
case U_or: next(); return OR;
|
|
||||||
case U_repeat: next(); return REPEAT;
|
|
||||||
case U_return: next(); return RETURN;
|
|
||||||
case U_then: next(); return THEN;
|
|
||||||
case U_until: next(); return UNTIL;
|
|
||||||
case U_while: next(); return WHILE;
|
|
||||||
case U_eq: next(); return EQ;
|
case U_eq: next(); return EQ;
|
||||||
case U_le: next(); return LE;
|
case U_le: next(); return LE;
|
||||||
case U_ge: next(); return GE;
|
case U_ge: next(); return GE;
|
||||||
|
|
16
ugly.h
16
ugly.h
|
@ -1,5 +1,15 @@
|
||||||
enum
|
/*
|
||||||
{
|
** ugly.h
|
||||||
|
** TecCGraf - PUC-Rio
|
||||||
|
** $Id: $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ugly_h
|
||||||
|
#define ugly_h
|
||||||
|
|
||||||
|
/* This enum must have the same order of the array 'reserved' in lex.c */
|
||||||
|
|
||||||
|
enum {
|
||||||
U_and=128,
|
U_and=128,
|
||||||
U_do,
|
U_do,
|
||||||
U_else,
|
U_else,
|
||||||
|
@ -22,3 +32,5 @@ enum
|
||||||
U_ne = '~'+128,
|
U_ne = '~'+128,
|
||||||
U_sc = '.'+128
|
U_sc = '.'+128
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue